资源简介
学习python和AI,用wxPython写了这个游戏包含求解,共享出来,欢迎喜欢AI的人交流
截图
http://highler.blogspot.com/2009/03/blog-post.html

代码片段和文件信息
# -*- coding: gbk -*-
import sys
import wx
import wx.html
import wx.lib.wxpTag
#---------------------------------------------------------------------------
class NGAboutBox(wx.Dialog):
NGOverview = “““
Number Game
填数字游戏规则:
九行九列共八十一格,分成九个三乘三的九宫格
需要将一到九数字填入八十一格中,使得每行每列
和每个九宫中包含一到九所有数字。
This is a game to enter numbers from 1 to 9.
It has one board which has 9 rows and 9 columns. Total 81 squares.
Rows and columns are using index 0 to 8
The board is also divided into 9 regions each region has 3 rows and 3 columns.
region=[startRowendRowstartColumnendColumn]
9 regions are
[0202][0235][0258]
[3502][3535][3558]
[5802][5835][5858]
The game rule is simple:
Each number must appear in rowscolumns and regions once.
Additional shortcut keys:
- Move cursor: ijklspace
- Enter number: 12..9
- Delete number: dbackspace
- Highlight number: .
Platform: %s
Python verion: %s
Written by highlertech@gmail.com
“““
def __init__(self parent):
wx.Dialog.__init__(self parent -1 ‘About The Number Game‘)
html = wx.html.HtmlWindow(self -1 size=(420 -1))
if “gtk2“ in wx.PlatformInfo:
html.SetStandardFonts()
py_version = sys.version.split()[0]
txt = self.NGOverview % (“ “.join(wx.PlatformInfo[1:])py_version)
html.SetPage(txt)
btn = html.FindWindowById(wx.ID_OK)
ir = html.GetInternalRepresentation()
html.SetSize( (ir.GetWidth()+25 ir.GetHeight()+25) )
self.SetClientSize(html.GetSize())
self.CentreOnParent(wx.BOTH)
if __name__ == ‘__main__‘:
app = wx.PySimpleApp()
dlg = NGAboutBox(None)
dlg.ShowModal()
dlg.Destroy()
app.MainLoop()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2113 2009-04-01 00:11 NGAbout.py
文件 23659 2009-04-01 00:22 NGBoard.py
文件 3181 2008-11-08 23:38 NGBoardPanel.py
文件 2966 2009-03-15 20:20 NGControlPanel.py
文件 2000004 2008-11-05 18:52 NGData.ngb
文件 6758 2009-03-01 00:09 NGMain.pyw
文件 174056 2009-03-21 23:17 NGRes.py
相关资源
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
- 量化交易(附python常见函数的使用方
- python 名字用字排行
评论
共有 条评论