15 puzzle game: Difference between revisions
m
Back to previous version, because of better understanding.
m (Changed cells initialization) |
m (Back to previous version, because of better understanding.) Tag: Manual revert |
||
Line 16,484:
const stdout = std.io.getStdOut().writer();
const empty_token = 15;▼
const tokens = [16][]const u8{ " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", "10", "11", "12", "13", "14", "15", " " };
▲const empty_token = 15;
var empty: u8 = empty_token;
var invalid: bool = false;
▲ var value: [16]u8 = undefined;
value[i] = @intCast(i);▼
}▼
const Move = enum { no, up, down, left, right };
Line 16,567 ⟶ 16,559:
pub fn main() !void {
var n: u8 = 0;
while (n < 16) : (n += 1) {
▲ }
try shuffle(50);
try showBoard();
Line 16,575 ⟶ 16,572:
}
}
</syntaxhighlight>
|