Created
October 23, 2019 02:27
-
-
Save IntegerMan/dbfbb6549e905bd3cd768f68f587c0eb to your computer and use it in GitHub Desktop.
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
using System.Text; | |
using MattEland.FSharpGeneticAlgorithm.Logic; | |
namespace MattEland.FSharpGeneticAlgorithm.WindowsClient | |
{ | |
internal class MainViewModel | |
{ | |
private readonly World.World _world; | |
public MainViewModel() | |
{ | |
_world = WorldGeneration.makeTestWorld(false); | |
} | |
public string TextGrid => BuildAsciiGrid(); | |
private string BuildAsciiGrid() | |
{ | |
var sb = new StringBuilder(); | |
for (int y = 1; y < _world.MaxY; y++) | |
{ | |
for (int x = 1; x < _world.MaxX; x++) | |
{ | |
sb.Append(World.getCharacterAtCell(x, y, _world)); | |
} | |
// Advance to the next line | |
sb.AppendLine(); | |
} | |
return sb.ToString(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment