Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,34 @@
open System
open System.Text.RegularExpressions
let mutable Inp = Console.In
let Out c = printf "%c" c; (if c = '.' then Environment.Exit 0)
let In() = Inp.Read() |> Convert.ToChar
let (|WordCharacter|OtherCharacter|) c =
if Regex.IsMatch(c.ToString(),"[a-zA-Z]") then
WordCharacter
else
OtherCharacter
let rec forward () =
let c = In()
let rec backward () : char =
let c = In()
match c with
| WordCharacter ->
let s = backward() in Out c; s
| OtherCharacter -> c
Out c
match c with
| WordCharacter -> forward()
| OtherCharacter -> backward()
[<EntryPoint>]
let main argv =
if argv.Length > 0 then Inp <- new System.IO.StringReader(argv.[0])
let rec loop () = forward() |> Out; loop()
loop()
0