Skip to content

Commit b90dbf7

Browse files
committed
Use fizz-buzz for squint demo sample code
1 parent 1cbbd01 commit b90dbf7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

public/squint/js/demo.mjs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,20 @@ let extensions = [ theme, foldGutter(),
3030
...default_extensions
3131
];
3232

33-
let state = EditorState.create( {doc: "(+ 1 2 3)",
33+
let state = EditorState.create( {doc: `(comment
34+
(fizz-buzz 1)
35+
(fizz-buzz 3)
36+
(fizz-buzz 5)
37+
(fizz-buzz 15)
38+
(fizz-buzz 17)
39+
(fizz-buzz 42))
40+
41+
(defn fizz-buzz [n]
42+
(condp (fn [a b] (zero? (mod b a))) n
43+
15 "fizzbuzz"
44+
3 "fizz"
45+
5 "buzz"
46+
n))`,
3447
extensions: extensions });
3548
let editorElt = document.querySelector('#editor');
3649
let editor = new EditorView({state: state,

0 commit comments

Comments
 (0)