aboutsummaryrefslogtreecommitdiff
path: root/src/playfield.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/playfield.zig')
-rw-r--r--src/playfield.zig38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/playfield.zig b/src/playfield.zig
new file mode 100644
index 0000000..3878323
--- /dev/null
+++ b/src/playfield.zig
@@ -0,0 +1,38 @@
+const std = @import("std");
+const spoon = @import("spoon");
+
+pub fn draw(rc: *spoon.Term.RenderContext) !void {
+ var iter = std.mem.split(u8, field, "\n");
+ var y: usize = 0;
+ while (iter.next()) |line| : (y += 1) {
+ try rc.moveCursorTo(y, 0);
+ _ = try rc.buffer.writer().write(line);
+ }
+}
+
+const field =
+ \\████████████████████████████████████████████████████████████████████████████████
+ \\█ ██ █
+ \\████████████████████████████████████████████████████████████████████████████████
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\█ ██ █
+ \\████████████████████████████████████████████████████████████████████████████████
+;