Handbook
Glossary
<sudoku-gadget> ( -- gadget )
Vocabulary
sudokus
Inputs
None
Outputs
gadget
an
object
Definition
USING:
accessors
arrays
grouping
kernel
math
math.parser
models.combinators
models.product
monads
sequences
ui.gadgets.controls
ui.gadgets.labels
ui.gadgets.layout
;
IN:
sudokus
:
<sudoku-gadget>
( -- gadget )
[
[
81
[
""
]
replicate
<basic>
switch-models
[
[
<basic>
]
map
9
group
[
3
group
]
map
3
group
[
[
~quotation~
<hbox>
,
]
map
concat
<spacer>
]
map
concat
<product>
[
"Difficulty:"
<label>
,
"1"
<basic>
<model-field>
->
[
string>number
1
or
1
+
10
*
]
fmap
"Generate"
<model-border-btn>
->
updates
[
create
]
fmap
<spacer>
"Hint"
<model-border-btn>
->
"Solve"
<model-border-btn>
->
]
<hbox>
,
roll
[
swap
updates
]
curry
bi@
[
[
hint
]
fmap
]
[
[
f
solution
]
fmap
]
bi*
3array
merge
[
[
~quotation~ ~quotation~
if*
]
map
]
fmap
]
bind
]
with-self
,
]
<vbox>
{
280 220
}
>>pref-dim
;