add day 2 part 1

This commit is contained in:
Lucien Cartier-Tilet 2023-11-10 22:45:35 +01:00
parent 12e65b8695
commit a7107c1a1e
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 10 additions and 0 deletions

10
day2-1.uiua Normal file
View File

@ -0,0 +1,10 @@
# %s/\(.\) \(.\)/"\1\2"_/
# %s/_$//
DecodeChar ← ((@S|@P)↥=@B=@Y.|⋅∘∶@R)↥=@A=@X..
CharValue ← |1 ⋅∘∶/(((3|2)=@P|⋅∘1)=@R.DecodeChar)
Battle ← ×3+1↥¯1↧1(∘|¯∘)×=0◿2,≠0.¯/-∵(⋅∘∶(=@P.|2)=@S.)
BattleChar ← |1 +CharValueBattle⊂/DecodeChar.
# @A_@X Rock -- @R
# @B_@Y Paper -- @P
# @C_@Z Scissors -- @S
/+≡BattleChar <input>