Concatenative language
Concatenative topics
Concatenative meta
Other languages
Meta
Stars is a classic forth example in which for a height of 20 lines, it draws 40 stars wide, and for each x y \% 0 = draws a star, it should look like this: [{ **************************************** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }] = [[Tal|Uxntal]] = [{ |0100 ( -> ) #1501 &for-i ( limit i -- ) STHk #2901 &for-j ( limit j -- ) DUP STHkr DIVk MUL SUB #202a ROT ?{ SWP } POP #18 DEO INC GTHk ?&for-j POP2 POPr #0a18 DEO INC GTHk ?&for-i POP2 BRK }] = [[Factor]] = [factor{: draw-stars ( -- ) 20 [1..b] [ 40 [1..b] swap '[ _ divisor? "*" " " ? write ] each nl ] each ;}] = [[Uiua]] = [{≡&p⊏:" *"=0⊞◿∩(+1⇡)20 40}]
Describe this revision:
Save