Example Solution:
Othello (aka 'Reversi')
(Console version)
- Which version of C#/ Visual Studio is required for this assignment?
-
The provided files are (obviously) C#, and (less obviously:) ) they were built using
the Visual Studio 2005 product. If you have an older version of Visual Studio (or
are using Mono), you probaby won't be able to open the Solution (.SLN) file. If
this is the case, in order to build this, you'll need to add all the .CS files to
a new project, and then everything should compile & run just fine.
- Other than the System.Random, and System.Console classes, this program uses no other
classes, so this *should* be good to go on VS 2003, and Mono ; it hasn't been tested
on those systems, though.
Refactoring / function decomposition
-
This assignment can be done without functions, but might be painful.
In particular, since both PlayToCell, and HasValidPositions both
have similar functionality (figure out if a move can be made).
In fact, if you're looking to offer some guidance about how to do
this, it might make the most sense to have a private overload of
PlayToCell which takes an extra boolean parameter, indicating
whether to flip game pieces or not. HasValidPositions could
simply iterate through all the squares on the board, and call
PlayToCell(col, row, false) on each one, the public PlayToCell can
then call PlayToCell(col, row, true) on the one it's interested in.
It should be simple enough to throw a quick skeleton around this
together, and include it in the StarterProject.