Clarified some stuff
This commit is contained in:
parent
d756ce5284
commit
1d005e747e
3 changed files with 4 additions and 5 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
# Zig2048
|
# Zig2048 (AI)
|
||||||
Just do (Zig build run) gang🥀🥀
|
Reduan's learing how to code adventure 🥀
|
||||||
|
Just do (zig build run) gng🥀🥀
|
||||||
|
|
||||||
# WIP
|
# WIP
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ fn tileColor(value: u16) []const u8 {
|
||||||
/// Draws the whole board to `out`. `*const Board` is a read-only view:
|
/// Draws the whole board to `out`. `*const Board` is a read-only view:
|
||||||
/// rendering physically cannot mutate game state.
|
/// rendering physically cannot mutate game state.
|
||||||
/// `{d:4}` prints each number right-aligned in a 4-column field so
|
/// `{d:4}` prints each number right-aligned in a 4-column field so
|
||||||
/// columns stay lined up once tiles grow to 3–4 digits.
|
/// columns stay lined up once tiles grow to 3-4 digits.
|
||||||
fn render(board: *const Board, out: *std.Io.Writer) !void {
|
fn render(board: *const Board, out: *std.Io.Writer) !void {
|
||||||
try out.print("\x1b[2J\x1b[H", .{}); // clear screen + cursor home
|
try out.print("\x1b[2J\x1b[H", .{}); // clear screen + cursor home
|
||||||
for (board.cells) |row| {
|
for (board.cells) |row| {
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Reference in a new issue