     @setState baru
 
   handleResetButton: ->
-    @setState
-      set: []
+    @setState set: []
 
   handlePlayButton: ->
-    {range} = @state
-    if range isnt ''
+    {range, maxLies} = @state
+    if range isnt '' && maxLies isnt ''
       @setState
         set: [[[1, range, Yes], [1, range, 0]]]
+        maxLies: min(16, max(0, maxLies))
 
   handleSubmitButton: ->
     if not @queryValidator()


  getInitialState: ->
    set: [] # truth set and lie set
    maxLies: 2 # maximal number of lies

    # input values
    range: 1000
    qa: 1
    qb: 500
    qx: No

  componentDidMount: ->
    @handlePlayButton()

  handleInputNumberChange: (event)->
    value = parseInt(event.target.value)

            dom 'label', className: 'u-invisible', 'i'
            dom 'button',
              type: 'button'
              className: 'button-primary'
              disabled: @state.set.length is 0
              onClick: @handleSubmitButton
              'Submit'
