This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let displayWorld (world: World) turnsRemaining = | |
printfn "" | |
printfn "%i turn(s) remaining" turnsRemaining | |
printfn "" | |
for y in 1..world.MaxX do | |
printf " " // Indent slightly so it is a bit more readable | |
for x in 1..world.MaxY do | |
// Determine which character should exist in this line | |
let char = world |> getCharacterAtCell(x,y) | |
// Let's set the overall color | |
match char with | |
| '.' -> Console.ForegroundColor <- ConsoleColor.DarkGreen | |
| 't' -> Console.ForegroundColor <- ConsoleColor.Green | |
| 'a' -> Console.ForegroundColor <- ConsoleColor.DarkYellow | |
| 'S' | 's' -> Console.ForegroundColor <- ConsoleColor.Yellow | |
| 'D' -> Console.ForegroundColor <- ConsoleColor.Red | |
| 'R' -> Console.ForegroundColor <- ConsoleColor.Magenta | |
| _ -> Console.ForegroundColor <- ConsoleColor.Gray | |
printCell char (x = world.MaxX) | |
// Ensure we go back to standard format | |
Console.ForegroundColor <- ConsoleColor.White |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment