Separate ansi code to its file
This commit is contained in:
parent
9245c619a9
commit
06646746c6
|
@ -0,0 +1,7 @@
|
||||||
|
ansi⇐{
|
||||||
|
e⇐@+27
|
||||||
|
red⇐e∾"[31m"
|
||||||
|
cyan⇐e∾"[36m"
|
||||||
|
yellow⇐e∾"[33m"
|
||||||
|
defaultB⇐e∾"[0m"
|
||||||
|
}
|
8
arc.bqn
8
arc.bqn
|
@ -5,6 +5,7 @@
|
||||||
# Arc
|
# Arc
|
||||||
# The level is a 2d matrix of lists (tiles)
|
# The level is a 2d matrix of lists (tiles)
|
||||||
# Each list contains the objects of the game represented as ints
|
# 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
|
moves←⟨0‿0⟩ # list of moves, each move is a direction, we start without moving
|
||||||
chars←" λ$⊕⭍#/\-|+<>^v" # legal characters
|
chars←" λ$⊕⭍#/\-|+<>^v" # legal characters
|
||||||
|
@ -15,13 +16,6 @@ lasers←llaser‿rlaser‿ulaser‿dlaser
|
||||||
movables←player‿box∾mirrors # player, box and mirrors
|
movables←player‿box∾mirrors # player, box and mirrors
|
||||||
opaque←player‿box‿machine‿wall∾lasers # non laser reflecting
|
opaque←player‿box‿machine‿wall∾lasers # non laser reflecting
|
||||||
empties←floor∾beams # floor and laser beams
|
empties←floor∾beams # floor and laser beams
|
||||||
ansi←{
|
|
||||||
e⇐@+27
|
|
||||||
red⇐e∾"[31m"
|
|
||||||
cyan⇐e∾"[36m"
|
|
||||||
yellow⇐e∾"[33m"
|
|
||||||
defaultB⇐e∾"[0m"
|
|
||||||
}
|
|
||||||
|
|
||||||
colors←(≠chars)⥊<ansi.defaultB # start with all glyphs being the default color
|
colors←(≠chars)⥊<ansi.defaultB # start with all glyphs being the default color
|
||||||
colors ansi.yellow˙⌾(pmachine⊸⊑)↩
|
colors ansi.yellow˙⌾(pmachine⊸⊑)↩
|
||||||
|
|
Loading…
Reference in New Issue