mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-07 02:24:33 -08:00
Add inner game loop
This commit is contained in:
@@ -23,13 +23,16 @@ internal class Cookie
|
||||
_bits[0][0] = 'P';
|
||||
}
|
||||
|
||||
public bool TryChomp(int row, int column)
|
||||
public bool TryChomp(int row, int column, out char chomped)
|
||||
{
|
||||
if (row < 1 || row > _rowCount || column < 1 || column > _columnCount || _bits[row - 1][column - 1] == ' ')
|
||||
{
|
||||
chomped = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
chomped = _bits[row - 1][column - 1];
|
||||
|
||||
for (int r = row; r <= _rowCount; r++)
|
||||
{
|
||||
for (int c = column; c <= _columnCount; c++)
|
||||
|
||||
Reference in New Issue
Block a user