Finish adding anonymous labels, unit tests

This commit is contained in:
2025-06-17 23:49:35 -07:00
parent b5c817d64d
commit 0f59dd668a
8 changed files with 166 additions and 4 deletions
@@ -0,0 +1,31 @@
---
source: src/labels/process.rs
expression: board_to_text(board)
---
#cycle 1
:_
#take gems 100 a
#give score 100
#_
:a
#take gems 10 b
#give score 10
#a
:b
#take gems 1 c
#give score 1
#b
:c
Your gems have been redeemed for score.
---
#end
:touch
#if not blocked rnd _
I'm another object with anonymous labels.
#end
:_
#if blocked rndne a
Anonymous label names can be reused.
#end
:a
Compare my code with the other object's.
@@ -0,0 +1,22 @@
---
source: src/labels/process.rs
expression: board_to_text(board)
---
#end
:touch
#take gems 100 lt_
#give gems 100
You have hundreds of gems.
#end
:lt_
#take gems 10 lt_0
#give gems 10
You have tens of gems.
#end
:lt_0
#take gems 1 lt1
#give gems 1
You have at least one gem.
#end
:lt1
You don't have any gems!