ref: b0f84dfff2d22507165a2c81e4faa094436ca82c
parent: 7fa76400ee03edb688ddd77d5635ea92f53fa2d0
author: glenda <glenda@cirno>
date: Sat Nov 1 14:46:56 EDT 2025
fix formatting
--- a/tarico
+++ b/tarico
@@ -1,13 +1,13 @@
#!/bin/rc
# cards by aquirax uno; used without permission
- rfork e
+rfork e
- url = https://triapul.cz/files/tarico
- fn roll{ awk 'BEGIN{ srand(); print int(0 + rand() * 21 ) }' }- fn flip{ awk 'BEGIN{ srand(); print int(1 + rand() * 2 ) }' }+url = https://triapul.cz/files/tarico
+fn roll{ awk 'BEGIN{ srand(); print int(0 + rand() * 21 ) }' }+fn flip{ awk 'BEGIN{ srand(); print int(1 + rand() * 2 ) }' }- fn caser{- switch($i){+fn caser{+ switch($i){case 0 ; echo $1 The Fool
case 1 ; echo $1 The Magician
case 2 ; echo $1 The High Priestess
@@ -30,24 +30,24 @@
case 19 ; echo $1 The Sun
case 20 ; echo $1 Judgement
case 21 ; echo $1 The World
- }
}
+}
- #shuffle
- cur = 'a'
- prev = 'b'
- prev2 = 'c'
+#shuffle
+cur = 'a'
+prev = 'b'
+prev2 = 'c'
- for (n in one two three) {- prev2=$prev
- prev=$cur
- $cur=`{roll}- while ( ~ $cur $prev || ~ $cur $prev2 || ~ $prev $prev2 ) {- cur=`{roll}-# echo dupe, reroll
- }
- shuffle = ( $shuffle $cur )
- }
+for (n in one two three) {+ prev2=$prev
+ prev=$cur
+ $cur=`{roll}+ while ( ~ $cur $prev || ~ $cur $prev2 || ~ $prev $prev2 ) {+ cur=`{roll}+# echo dupe, reroll
+ }
+ shuffle = ( $shuffle $cur )
+}
# the window `hack' makes sure that page is of the correct size (fit to image).
# page -w only resizes to the image, if it's focused (only the first picture
@@ -54,14 +54,15 @@
# would be resized otherwise. bug in page? -
# try ` for ( i in image1 image2 ) { page -w $i & } '- for ( i in $shuffle ) {- if (~ `{flip} 1) {- window -dx 445 -dy 745 'hget '^$url^'/'^$i^' | png -c | rotate -r 180 | page -R'
- r=r.
- }
- if not { - window -dx 445 -dy 745 'hget '^$url^'/'^$i^' | png -c | page -R'
- r=()
- }
- caser $r
+for ( i in $shuffle ) {+ if (~ `{flip} 1) {+ window -dx 445 -dy 745 'hget '^$url^'/'^$i^' | png -c | rotate -r 180 | page -R'
+ r=r.
}
+ if not { + window -dx 445 -dy 745 'hget '^$url^'/'^$i^' | png -c | page -R'
+ r=()
+ }
+ caser $r
+}
+
--
⑨