---------------------------------------- Porting an ANSI C application to Plan 9 May 23 2021 ---------------------------------------- The distinct lack of a reversi game in any version of Plan 9 has yet to be remedied upstream, and knowing that I should not survive much longer without that game, I took it upon myself to see what porting an existing game requires. Lo and behold, it wasn't too bad a process once I found a reversi game written in proper ANSI C. Here are some of my notes along the way. If you would like to get a look at the original source code yourself, you can find it here: => http://www.java2s.com/Code/C/String/REVERSIAnOthellotypegame.htm The source code needs a couple of things right off the bat. The Plan 9 C libraries used for its functions are a little different: #include #include #include #include As far as I know, "u.h" is present in every Plan 9 C program. The code conventions for source code under Plan 9 are also a bit different from what many of us are used to seeing these days, and the most immediate difference is that function return types are written on their own line. Curly braces never occupy the same line as the function declaration, either. The long and short here is that this: void display(char board[][SIZE]) {...} ... doesn't fly. Instead, you should write: void display(char board[][SIZE]) { ... } That might seem a little strange, but I've begun to find this a bit more readable compared to the first example. It also makes the top-level function name easy to search (/^display/). Believe it or not, this was all it took for the program to compile, but after tidying things up a bit, I thought this might be a good time to also learn about mkfiles under Plan 9. This was another thing the Plan 9 designers aimed to simplify, and once I learned a bit about it, I have to say it's pretty refreshing. Here is my "first blush" mkfile: