websites.factorcode: more examples.
parent
9237a4f289
commit
835a83d311
|
@ -83,14 +83,8 @@ USING: io io.encodings.ascii io.files
|
||||||
random sequences splitting ;
|
random sequences splitting ;
|
||||||
|
|
||||||
"/usr/share/games/fortune/fortunes"
|
"/usr/share/games/fortune/fortunes"
|
||||||
ascii file-lines { "%" } split
|
ascii file-lines { "%" } split random
|
||||||
random [ print ] each
|
[ print ] each
|
||||||
----
|
|
||||||
USING: morse text-to-speech ;
|
|
||||||
|
|
||||||
"Hello, world!" speak-text
|
|
||||||
|
|
||||||
"Factor" play-as-morse
|
|
||||||
----
|
----
|
||||||
USING: combinators io kernel locals
|
USING: combinators io kernel locals
|
||||||
math.functions math.parser math.ranges
|
math.functions math.parser math.ranges
|
||||||
|
@ -104,3 +98,20 @@ sequences ;
|
||||||
[ i number>string ]
|
[ i number>string ]
|
||||||
} cond print
|
} cond print
|
||||||
] each
|
] each
|
||||||
|
----
|
||||||
|
USING: kernel math sequences text-to-speech ;
|
||||||
|
|
||||||
|
"factor"
|
||||||
|
|
||||||
|
dup [ "aeiou" member? ] find drop [
|
||||||
|
[ "way" append ]
|
||||||
|
[ cut swap "ay" 3append ] if-zero
|
||||||
|
] when*
|
||||||
|
|
||||||
|
speak-text
|
||||||
|
----
|
||||||
|
USING: math.text.english morse sequences ;
|
||||||
|
|
||||||
|
{ 4 8 15 16 23 42 } [
|
||||||
|
number>text play-as-morse
|
||||||
|
] each
|
||||||
|
|
Loading…
Reference in New Issue