Generating ML file with words.

This commit is contained in:
Simon Castellan 2022-02-13 10:48:11 +00:00
parent 0644c6cf43
commit dd84d98750
3 changed files with 12 additions and 1 deletions

5
dune
View File

@ -1,3 +1,8 @@
(rule
(target "word.ml")
(deps (glob_files "words"))
(action (bash "./gen_words.sh")))
(executable
(name evilWordle)
(libraries js_of_ocaml brr lwd brr-lwd)

6
gen_words.sh Executable file
View File

@ -0,0 +1,6 @@
#! /bin/bash
(echo 'let list = [';
cat words | sed 's/^\(.*\)/"\1";/g';
echo ']') | sed 's/;]/]/g' > word.ml

View File

@ -45,7 +45,7 @@ let create () =
; container= Elwd.div ~at:[`P (At.id (Jstr.v "grid"))] [`S el_list]
; elements= el_matrix
; status
; words= []
; words= Word.list
; chars }
let display t = t.container