From 06646746c6bcaba576c5b45e8dd8165140fd7104 Mon Sep 17 00:00:00 2001 From: Rampoina Date: Sun, 5 Mar 2023 03:10:27 +0100 Subject: [PATCH] Separate ansi code to its file --- ansi.bqn | 7 +++++++ arc.bqn | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 ansi.bqn diff --git a/ansi.bqn b/ansi.bqn new file mode 100644 index 0000000..c23ea53 --- /dev/null +++ b/ansi.bqn @@ -0,0 +1,7 @@ +ansi⇐{ + e⇐@+27 + red⇐e∾"[31m" + cyan⇐e∾"[36m" + yellow⇐e∾"[33m" + defaultB⇐e∾"[0m" +} diff --git a/arc.bqn b/arc.bqn index 7d3ead6..d01d5eb 100755 --- a/arc.bqn +++ b/arc.bqn @@ -5,6 +5,7 @@ # Arc # The level is a 2d matrix of lists (tiles) # Each list contains the objects of the game represented as ints +⟨ansi⟩←•Import "ansi.bqn" moves←⟨0‿0⟩ # list of moves, each move is a direction, we start without moving chars←" λ$⊕⭍#/\-|+<>^v" # legal characters @@ -15,13 +16,6 @@ lasers←llaser‿rlaser‿ulaser‿dlaser movables←player‿box∾mirrors # player, box and mirrors opaque←player‿box‿machine‿wall∾lasers # non laser reflecting empties←floor∾beams # floor and laser beams -ansi←{ - e⇐@+27 - red⇐e∾"[31m" - cyan⇐e∾"[36m" - yellow⇐e∾"[33m" - defaultB⇐e∾"[0m" -} colors←(≠chars)⥊