Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $ = require('jquery')
- require('cycle-shell')(main, {
- welcome: `Hello play the number game 1 to 456`
- })
- setBackgroundColor(`darkblue`)
- var answer = getRandomNumber(456)
- function main (input) {
- if (input === answer){
- return`correct good for you`
- }else{
- return renderHint(input)
- }
- }
- function renderHint (guess){
- if(guess>answer){
- return`Hint:too high try again`
- }else{
- return`Hint:it's too low try again`
- }
- }
- function getRandomNumber (max){
- return Math.floor(Math.random() *max) + 1
- }
- function setBackgroundColor (color) {
- setTimeout(function() {
- $(`.app`).css(`background`,color)
- }, 50)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement