Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Rep-string/SNOBOL4/rep-string.sno
Normal file
11
Task/Rep-string/SNOBOL4/rep-string.sno
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
* Rep-string
|
||||
strings = "1001110011 1110111011 0010010010 1010101010 1111111111 0100101101 0100100 101 11 00 1 "
|
||||
pat1 = (len(1) $ fc breakx(*fc)) $ x *x (arbno(*x) (rpos(0) | rem $ y *?(x ? y)))
|
||||
getstring
|
||||
strings ? (break(" ") . rs len(1)) = :f(end)
|
||||
rs ? pat1 :s(yes)
|
||||
output = rs " is not a rep-string -> n/a" :(getstring)
|
||||
yes
|
||||
output = rs " has shortest rep-string value of -> " x
|
||||
:(getstring)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue