···11-22-33-# Check if a directory name is provided
44-if [ -z "$1" ]; then
55- echo "Usage: $0 directory"
66- exit 1
77-fi
88-99-directory=$1
1010-1111-# Check if the provided argument is a directory
1212-if [ ! -d "$directory" ]; then
1313- echo "Error: $directory is not a directory"
1414- exit 1
1515-fi
1616-1717-# Loop through all files in the directory
1818-for exampledir in "$directory"/*; do
1919- if [ -d "$exampledir" ]; then
2020- string_file="$exampledir/strings.gleam"
2121- lustre_file="$exampledir/lustre.gleam"
2222- nakai_file="$exampledir/nakai.gleam"
2323-2424- # echo $string_file
2525- # echo $lustre_file
2626- # echo $nakai_file
2727-2828- cp $string_file $lustre_file
2929- cp $string_file $nakai_file
3030-3131- sed -i '' 's|formz/string_generator|formz_lustre|g' "$lustre_file"
3232- sed -i '' 's|formz/string_generator|formz_nakai|g' "$nakai_file"
3333-3434- echo "copied $string_file"
3535- fi
3636-done
+2
formz_demo/gleam.toml
···2424lustre = ">= 4.5.1 and < 5.0.0"
2525nakai = ">= 1.0.0 and < 2.0.0"
2626simplifile = ">= 2.2.0 and < 3.0.0"
2727+justin = ">= 1.0.1 and < 2.0.0"
2828+pprint = ">= 1.0.3 and < 2.0.0"
27292830[dev-dependencies]
2931gleeunit = ">= 1.0.0 and < 2.0.0"
+4
formz_demo/manifest.toml
···1010 { name = "formz", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "justin"], source = "local", path = "../formz" },
1111 { name = "formz_lustre", version = "1.0.0", build_tools = ["gleam"], requirements = ["formz", "gleam_stdlib", "lustre"], source = "local", path = "../formz_lustre" },
1212 { name = "formz_nakai", version = "1.0.0", build_tools = ["gleam"], requirements = ["formz", "gleam_stdlib", "nakai"], source = "local", path = "../formz_nakai" },
1313+ { name = "glam", version = "2.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glam", source = "hex", outer_checksum = "66EC3BCD632E51EED029678F8DF419659C1E57B1A93D874C5131FE220DFAD2B2" },
1314 { name = "gleam_crypto", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "8AE56026B3E05EBB1F076778478A762E9EB62B31AEEB4285755452F397029D22" },
1415 { name = "gleam_erlang", version = "0.27.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "DE468F676D71B313C6C8C5334425CFCF827837333F8AB47B64D8A6D7AA40185D" },
1516 { name = "gleam_http", version = "3.7.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "EA66440C2269F7CED0F6845E5BD0DB68095775D627FA709A841CA78A398D6D56" },
···2728 { name = "mist", version = "3.0.0", build_tools = ["gleam"], requirements = ["birl", "gleam_erlang", "gleam_http", "gleam_otp", "gleam_stdlib", "glisten", "gramps", "hpack_erl", "logging"], otp_app = "mist", source = "hex", outer_checksum = "CDA1A74E768419235E16886463EC4722EFF4AB3F8D820A76EAD45D7C167D7282" },
2829 { name = "nakai", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "nakai", source = "hex", outer_checksum = "FD55B7926640FFD21FCC048D7E21752ED94FD424E1A731DC5C9DFB9928007F08" },
2930 { name = "platform", version = "1.0.0", build_tools = ["gleam"], requirements = [], otp_app = "platform", source = "hex", outer_checksum = "8339420A95AD89AAC0F82F4C3DB8DD401041742D6C3F46132A8739F6AEB75391" },
3131+ { name = "pprint", version = "1.0.3", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "76BBB92E23D12D954BD452686543F29EDE8EBEBB7FC0ACCBCA66EEF276EC3A06" },
3032 { name = "ranger", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "ranger", source = "hex", outer_checksum = "1566C272B1D141B3BBA38B25CB761EF56E312E79EC0E2DFD4D3C19FB0CC1F98C" },
3133 { name = "simplifile", version = "2.2.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0DFABEF7DC7A9E2FF4BB27B108034E60C81BEBFCB7AB816B9E7E18ED4503ACD8" },
3234 { name = "telemetry", version = "1.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "telemetry", source = "hex", outer_checksum = "7015FC8919DBE63764F4B4B87A95B7C0996BD539E0D499BE6EC9D7F3875B79E6" },
···4244gleam_http = { version = ">= 3.7.0 and < 4.0.0" }
4345gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
4446gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
4747+justin = { version = ">= 1.0.1 and < 2.0.0" }
4548lustre = { version = ">= 4.5.1 and < 5.0.0" }
4649mist = { version = ">= 3.0.0 and < 4.0.0" }
4750nakai = { version = ">= 1.0.0 and < 2.0.0" }
5151+pprint = { version = ">= 1.0.3 and < 2.0.0" }
4852simplifile = { version = ">= 2.2.0 and < 3.0.0" }
4953wisp = { version = ">= 1.2.0 and < 2.0.0" }
···11-pub type Alphabet {
22- A
33- B
44- C
55- D
66- E
77- F
88- G
99- H
1010- I
1111- J
1212- K
1313- L
1414- M
1515- N
1616- O
1717- P
1818- Q
1919- R
2020- S
2121- T
2222- U
2323- V
2424- W
2525- X
2626- Y
2727- Z
2828-}