aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/tasks.json19
-rw-r--r--LICENCE.md3
-rw-r--r--README.md5
-rw-r--r--main.exebin0 -> 369152 bytes
-rw-r--r--main.odin59
-rw-r--r--main.pdbbin0 -> 3821568 bytes
-rw-r--r--odin-frogger-debug-session.rdbgbin0 -> 543 bytes
7 files changed, 86 insertions, 0 deletions
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..16477da
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,19 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "type": "shell",
+ "command": "odin run .\\main.odin -file -strict-style -debug",
+ "group": "build",
+ "presentation": {
+ // Reveal the output only if unrecognized errors occur.
+ "reveal": "silent"
+ },
+ // Use the standard MS compiler pattern to detect errors, warnings and infos
+ "problemMatcher": "$msCompile"
+ }
+ ]
+} \ No newline at end of file
diff --git a/LICENCE.md b/LICENCE.md
new file mode 100644
index 0000000..ac1f876
--- /dev/null
+++ b/LICENCE.md
@@ -0,0 +1,3 @@
+Luke Smith Licenceā„¢
+
+If you ask, you can't use it.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..346843d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# odin-frogger
+
+Really shitty turn-based frogger I'm writing in [odin](https://odin-lang.org/) to see if I like it.
+
+Also, yes. `.vscode/`. Cringe. I know. I just can't be bothered to set up autocomplete for odin in vim. \ No newline at end of file
diff --git a/main.exe b/main.exe
new file mode 100644
index 0000000..016fbd3
--- /dev/null
+++ b/main.exe
Binary files differ
diff --git a/main.odin b/main.odin
new file mode 100644
index 0000000..5357595
--- /dev/null
+++ b/main.odin
@@ -0,0 +1,59 @@
+package main
+
+import "core:fmt"
+import "core:os"
+import "core:bufio"
+import "core:io"
+import "core:strconv"
+import "core:strings"
+
+instructions: string = "Use space to stay still, and HJKL to move."
+
+main :: proc() {
+ fmt.println("What's your name? ")
+ name: string = getln()
+ defer delete(name)
+ fmt.printf("Hello %v! Welcome to shitty frogger.\n\n", name)
+
+ fmt.println(instructions)
+
+ // Two options for this implementation:
+ // 1. Structs for rows that contain data about what direction they flow
+ // - Problem: No neat way to declare the lines with a custom length at runtime
+ // - Solution: Pointer shit maybe. Ugh.
+ // 2. Separate array that contains booleans for what direction they flow
+ // - Problem: Data feels separate, which feels wonky, but might be fine
+ //
+ //
+ //
+ //
+}
+
+getln :: proc() -> string {
+ buf: [256]u8
+ bytes_read, ok := os.read(os.stdin, buf[:])
+ //assert(ok)
+ read_input := string(buf[:bytes_read-2])
+ return strings.clone(read_input)
+}
+
+getint :: proc() -> int {
+ buf: [256]u8
+ for {
+ read_input := getln()
+ output, ok := strconv.parse_int(read_input)
+ if ok {
+ return output
+ } else {
+ fmt.println("That's not a normal whole number, mate.")
+ }
+ }
+}
+
+getrune :: proc() -> rune {
+ buf: [256]u8
+ bytes_read, ok := os.read(os.stdin, buf[:])
+ //assert(ok)
+ read_input := rune(buf[0])
+ return read_input
+}
diff --git a/main.pdb b/main.pdb
new file mode 100644
index 0000000..6397bcf
--- /dev/null
+++ b/main.pdb
Binary files differ
diff --git a/odin-frogger-debug-session.rdbg b/odin-frogger-debug-session.rdbg
new file mode 100644
index 0000000..b871545
--- /dev/null
+++ b/odin-frogger-debug-session.rdbg
Binary files differ