Posted by Chanwit Kaewkasi on Wed 17 Sep 06:32 (modification of post by Chanwit Kaewkasi view diff)
report abuse | View followups from Chanwit Kaewkasi | download | new post
- <?xml version="1.0" encoding="UTF-8"?>
- <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
- <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
- <?page zscriptLanguage="GroovyGrails"?>
- <zk>
- <zscript>
- class Hangman {
- def wrong
- def correct = 0
- def r=''
- r += "${it} "
- }
- return r
- }
- def word
- this.word = value
- }
- }
- def guess = { ch ->
- word.eachWithIndex { it, i ->
- buffer[i] = it
- correct++
- right = true
- }
- }
- wrong++
- }
- }
- }
- words = ['polyglot','alliance','web']
- nextstep = {
- hangman.guess self.label
- answer.value = hangman.revealedWord
- imgStep.src = "images/hangman/step${hangman.wrong+1}.gif"
- }
- }
- </zscript>
- <vbox>
- <hbox>
- Number of Wrong Guess:
- <label id="count" value="${hangman.wrong}"/>
- </hbox>
- <image id="imgStep" src="images/hangman/step1.gif"/>
- <hbox>
- The Word:
- <label id="answer" value="${hangman.revealedWord}"/>
- </hbox>
- Chracters:
- <hbox>
- </hbox>
- <hbox>
- </hbox>
- <box height="20px"/>
- <label value="New Game?"
- style="cursor: pointer; text-decoration: underline; color: maroon;"
- onClick="Executions.sendRedirect 'index.zul'"/>
- </vbox>
- </zk>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.