Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
9
Task/Substring-Top-and-tail/Ed/substring-top-and-tail.ed
Normal file
9
Task/Substring-Top-and-tail/Ed/substring-top-and-tail.ed
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# by Artyom Bologov
|
||||
H
|
||||
t0
|
||||
t0
|
||||
1s/.\(.*\)/\1/
|
||||
2s/\(.*\)./\1/
|
||||
3s/.\(.*\)./\1/
|
||||
,p
|
||||
Q
|
||||
6
Task/Substring-Top-and-tail/Nu/substring-top-and-tail.nu
Normal file
6
Task/Substring-Top-and-tail/Nu/substring-top-and-tail.nu
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
1..
|
||||
..-2
|
||||
1..-2
|
||||
]
|
||||
| each {|range| '>test<' | str substring $range }
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
process
|
||||
local stream s variable initial {'brooms', 'hit'}
|
||||
repeat over s
|
||||
output '---------------------%nWord: %g(s)%n'
|
||||
do scan s
|
||||
match any-text any-text+ => firstremoved
|
||||
output 'First removed: %x(firstremoved)%n'
|
||||
done
|
||||
do scan s
|
||||
match ((lookahead not (any-text value-end)) any)+ => lastremoved
|
||||
output 'Last removed: %x(lastremoved)%n'
|
||||
done
|
||||
do scan s
|
||||
match any-text ((lookahead not (any-text value-end)) any)+ => bothremoved
|
||||
output 'Both removed: %x(bothremoved)%n'
|
||||
done
|
||||
again
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
include "utf8pat.xin"
|
||||
|
||||
define stream function ucps (value stream chars) as
|
||||
local integer num
|
||||
local stream unicodes
|
||||
open unicodes as buffer
|
||||
repeat scan chars
|
||||
match utf8-char => s-char
|
||||
set num to utf8-char-number(s-char)
|
||||
put unicodes 'U+%u16r4fzd(num) '
|
||||
again
|
||||
close unicodes
|
||||
return unicodes
|
||||
|
||||
process
|
||||
local stream s variable initial {'brooms', '𝓱𝓲𝓽', 'là'}
|
||||
repeat over s
|
||||
output '----------------------------------------------------------------%n'
|
||||
output 'Word: %g(s)%n ' || ucps(s) || '%n'
|
||||
do scan s
|
||||
match utf8-char utf8-char+ => firstremoved
|
||||
output 'First removed: %x(firstremoved)%n '
|
||||
output ucps(firstremoved) || '%n'
|
||||
done
|
||||
do scan s
|
||||
match ((lookahead not (utf8-char value-end)) any)+ => lastremoved
|
||||
output 'Last removed: %x(lastremoved)%n '
|
||||
output ucps(lastremoved) || '%n'
|
||||
done
|
||||
do scan s
|
||||
match utf8-char ((lookahead not (utf8-char value-end)) any)+ => bothremoved
|
||||
output 'Both removed: %x(bothremoved)%n '
|
||||
output ucps(bothremoved) || '%n'
|
||||
done
|
||||
again
|
||||
Loading…
Add table
Add a link
Reference in a new issue