Skip to content

Instantly share code, notes, and snippets.

@cxytomo
Last active December 16, 2015 02:29
Show Gist options
  • Save cxytomo/5362617 to your computer and use it in GitHub Desktop.
Save cxytomo/5362617 to your computer and use it in GitHub Desktop.
var canv = document.getElementById('game')
, contxt = canv.getContext('2d')
, guess = 3 //猜测的次数
, message = "Guess The Letter From a(lower) to z(higher)"//游戏提示
, letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
, today = new Date()//日期显示
, letterToGuess = ""//系统随机产生的待猜测的字母
, letterToGArray = []//游戏结束时,用于显示待猜测字母
, LowerOrHigher = ""//每次键按下后对用户提示
, lettersGuessed//存放已经按过的字母
, index//待猜测字母在letters数组中的索引值
, game = false;//用户猜测成功后为true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment