From b5dd8929b750d686b1d8086b438281918b90f499 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Sat, 4 Mar 2023 18:50:07 +0100 Subject: [PATCH] Remove trailing whitespace --- README.md | 2 +- arc.bqn | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 65d9af6..918e704 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,6 @@ Otherwise: 1. `make` to compile CBQN (`make CC=cc` if clang isn't installed) 2. `make run` to run the game -## License +## License Sokobqn is licensed as AGPLv3 diff --git a/arc.bqn b/arc.bqn index 1ac48a1..4e7ad55 100755 --- a/arc.bqn +++ b/arc.bqn @@ -28,21 +28,21 @@ Ascii2Matrix←{(⊑chars⊐𝕩)⊑⟨≍0,1‿0,2‿0,≍3,1‿3,2‿3,≍6,7 Tiles←{⟨𝕩,𝕩+𝕨,𝕩+2×𝕨⟩} # given object (including itself) # Move 𝕩 | 𝕩: ⟨⟨1,0⟩,⟨0⟩⟩ (2 tiles) | result: ⟨⟨0⟩,⟨1,0⟩⟩ -# Move the first object in the first tile to the second tile. +# Move the first object in the first tile to the second tile. # Only move Movable tile -> Empty tile # the second tile can't be a movable object because we moved it previously # if it is it means that the object was unmovable (next to a wall) so we do nothing Move←{a‿b:⟨1↓a,(⊑a)∾b⟩}⍟{∨´(⥊movables≍⌜empties)≡⌜<⊑¨𝕩} # Push 𝕩 | 𝕩: ⟨⟨1,0⟩,⟨2,0⟩,⟨0,0)⟩ (3 tiles) | result: ⟨⟨0⟩,⟨1,0⟩,⟨2,0)⟩ -# Given 3 tiles try to [P]ush the second tile (possible box) +# Given 3 tiles try to [P]ush the second tile (possible box) # and afterwards try to move the first one (player) if possible Push←Move⌾(2↑⊢)Move⌾(1↓⊢) FindIdx←/○⥊⟜(↕≢)∘⍷ # 𝕨 Beam 𝕩 | 𝕨: level | 𝕩: position | replace positions with the laser beam -Beam←{{"--++"⊏˜" -|+"⊐𝕩}⌾(𝕩⊸⊑)𝕨} +Beam←{{"--++"⊏˜" -|+"⊐𝕩}⌾(𝕩⊸⊑)𝕨} # w‿d Bounce x | x: map | w‿d: w: current position, d: direction of the laser # Calculates the bounces of a laser beam recursively @@ -88,7 +88,6 @@ clear←"" {𝕤⋄moves↩⟨0‿0⟩}⍟(key='r')@ {𝕤⋄clear↩e∾"[2J"}⍟(((1⊸+>○(⌊1+10⋆⁼1⌈⊢)⊢)¯1+≠moves)∧key='u')@ •Out e∾"8" # Restore cursor position - {𝕤⋄•Out clear∾ansi.yellow∾"⭍"∾ansi.defaultB∾" Power the machines (⊕) by moving the mirrors ("∾ansi.cyan∾"\/"∾ansi.defaultB∾")"∾(@+10)∾"Controls: (hjkl or wasd) to move, u to undo, r to reset level, q to quit"}⍟(⊑key∊"wasdhjkluqr")@ {𝕤⋄•Out "Invalid key: (hjkl or wasd) to move, u to undo, r to reset level"}⍟(¬⊑key∊"wasdhjkluqr")@ •Out¨ (currentLevel⊑levels) Draw moves