diff --git a/arc.bqn b/arc.bqn index a504a8e..40f2100 100755 --- a/arc.bqn +++ b/arc.bqn @@ -12,7 +12,8 @@ e←ansi.e •term.RawMode 1 # set terminal to raw mode •Out e∾"[?25l"∾e∾"[2J"∾e∾"[H" # Cursor to origin, hide it and clear screen clear←"" -g←Game "levels" + +g←Game "levels"‿" λ$⊕⭍#/\-|+<>^v"‿⟨ansi.defaultB,ansi.yellow,ansi.cyan,ansi.red⟩ {𝕤 # Loop until the user wins •Out clear∾e∾"[H" # Cursor to origin clear↩"" diff --git a/logic.bqn b/logic.bqn index 3f7ae1b..c53bbe9 100644 --- a/logic.bqn +++ b/logic.bqn @@ -1,11 +1,9 @@ #!/usr/bin/env BQN # SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-FileCopyrightText: 2023 Rampoina -⟨ansi⟩←•Import "ansi.bqn" - Game⇐{ + 𝕊 levelPath‿chars‿colors: moves⇐⟨0‿0⟩ # list of moves, each move is a direction, we start without moving - chars←" λ$⊕⭍#/\-|+<>^v" # legal characters: ⟨floor,player,box,machine,pmachine,wall,lmirror,rmirror,hbeam,vbeam,xbeam,llaser,rlaser,ulaser,dlaser⟩←↕≠chars beams←hbeam‿vbeam‿xbeam mirrors←lmirror‿rmirror @@ -14,11 +12,11 @@ Game⇐{ opaque←player‿box‿machine‿wall∾lasers # non laser reflecting empties←floor∾beams # floor and laser beams - colors←(≠chars)⥊¨SplitOnEmpty•FLines 𝕩 # Load file containing levels + levels←Ascii2Matrix¨>¨SplitOnEmpty•FLines levelPath # Load file containing levels currentLevel⇐0 }