Skip to content

Commit

Permalink
Use fizz-buzz for squint demo sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Nov 5, 2023
1 parent 1cbbd01 commit b90dbf7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion public/squint/js/demo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@ let extensions = [ theme, foldGutter(),
...default_extensions
];

let state = EditorState.create( {doc: "(+ 1 2 3)",
let state = EditorState.create( {doc: `(comment
(fizz-buzz 1)
(fizz-buzz 3)
(fizz-buzz 5)
(fizz-buzz 15)
(fizz-buzz 17)
(fizz-buzz 42))
(defn fizz-buzz [n]
(condp (fn [a b] (zero? (mod b a))) n
15 "fizzbuzz"
3 "fizz"
5 "buzz"
n))`,
extensions: extensions });
let editorElt = document.querySelector('#editor');
let editor = new EditorView({state: state,
Expand Down

0 comments on commit b90dbf7

Please sign in to comment.