Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created October 23, 2019 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/dbfbb6549e905bd3cd768f68f587c0eb to your computer and use it in GitHub Desktop.
Save IntegerMan/dbfbb6549e905bd3cd768f68f587c0eb to your computer and use it in GitHub Desktop.
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