Skip to content

Commit

Permalink
refactor: formatting arkscript examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed Sep 23, 2024
1 parent 8d52fb3 commit 2c0ae24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/games/game_of_life.ark
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
(mut x (math:floor (mod i width)))

(if (= 0 x) (puts "\n"))

(if (= alive (@ board i))
(puts "x")
(puts " "))
Expand Down
4 changes: 2 additions & 2 deletions examples/games/snake/snake.ark
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
(if (= _y y)
(while (!= _x 20) {
(mut case (@ (@ data _y) _x))

(if (= _x x)
(set case 0)
())
Expand All @@ -107,7 +108,6 @@

(return test) }
(throw "Out of bounds"))))

(fun (&data &apple_sprite &draw_board &has_apple_left? &eat_apple_at) ()) }))

# instanciating
Expand Down Expand Up @@ -155,7 +155,6 @@
(sf:set:pos snake_sprite (* 20 (@ current 0)) (* 20 (@ current 1)))
(sf:draw snake_sprite)
(set acc (+ 1 acc)) }) }))

(fun (&move &reset_auto_move &auto_move &draw &pos &should_move &last_direction &snake_sprite) ()) }))

# instanciating
Expand Down Expand Up @@ -202,6 +201,7 @@
# rendering
(sf:window:clear 0 0 0)
(board.draw_board)

# draw board first
(snake.draw)

Expand Down

0 comments on commit 2c0ae24

Please sign in to comment.