guess_number

所属分类:游戏
开发工具:Others
文件大小:2KB
下载次数:18
上传日期:2014-11-28 18:50:59
上 传 者tsinghuasoft
说明:  haskell实现的经典的猜数字游戏,猜一个四位数字,每猜一次数字返回A*B*表示猜中的数字和位置猜中的数字,本算法保证不超过8次,且不利用任何的筛选机制(意味着内存消耗几乎为0),经本机测试,猜出0123到9876(四位数字不相同),naive算法的时间最快为10到20分钟,此算法采用数学计算,只需0.5秒,恩,函数式语言设计,恩,就是你想找的。
(haskell achieve classic guessing game, guess a four-digit number, each digit returns guess one A* B* denote digit number and location guessed guessed, this algorithm ensures that no more than 8 times, and do not use any of the screening mechanism (meaning the memory consumption is almost zero), tested by this machine, guess 0123-9876 (four numbers are not the same), naive algorithm is the fastest time for 10-20 minutes, this algorithm uses mathematical calculations, only 0.5 sec, uh, functional language design, uh, what you are looking for.)

文件列表:
Main.hs (2525, 2014-11-25)
GuessGame.hs (2840, 2014-11-25)

近期下载者

相关文件


收藏者