Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
F squeeze(input, include)
|
||||
V s = ‘’
|
||||
L(i) 0 .< input.len
|
||||
I i == 0 | input[i - 1] != input[i] | (input[i - 1] == input[i] & input[i] != include)
|
||||
s ‘’= input[i]
|
||||
R s
|
||||
|
||||
V testStrings = [
|
||||
‘’,
|
||||
‘"If I were two-faced, would I be wearing this one?" --- Abraham Lincoln ’,
|
||||
‘..1111111111111111111111111111111111111111111111111111111111111117777888’,
|
||||
‘I never give 'em hell, I just tell the truth, and they think it's hell. ’,
|
||||
‘ --- Harry S Truman ’,
|
||||
‘122333444455555666666777777788888888999999999’,
|
||||
‘The better the 4-wheel drive, the further you'll be from help when ya get stuck!’,
|
||||
‘headmistressship’
|
||||
]
|
||||
|
||||
V testChar = [
|
||||
‘ ’,
|
||||
‘-’,
|
||||
‘7’,
|
||||
‘.’,
|
||||
‘ -r’,
|
||||
‘5’,
|
||||
‘e’,
|
||||
‘s’
|
||||
]
|
||||
|
||||
L(testNum) 0 .< testStrings.len
|
||||
V s = testStrings[testNum]
|
||||
L(c) testChar[testNum]
|
||||
V result = squeeze(s, c)
|
||||
print("use: '#.'\nold: #2 <<<#.>>>\nnew: #2 <<<#.>>>\n".format(c, s.len, s, result.len, result))
|
||||
Loading…
Add table
Add a link
Reference in a new issue