数独是一种逻辑解谜游戏,它规则稍复杂,解题过程富有挑战性。

游戏规则:很简单。 游戏棋盘是一个9x9的格网,被划分成3x3个区域,每个区域是一块九宫格。玩家需要在格内填入1到9的数字,其中一些数字在游戏开始时已经给出。 每一行,每一列,以及每一块九宫格区域内的数字必须是唯一的,不允许出现重复。简单的还需要又2*2以满足初级玩家游玩。


首先需要做出棋盘,数据模式来源于接口返回值,大多为字符串格式,我们首先要把他转换为多维数组。

let gameOriginData=1.2.23.4.231.142

for (let i = 0; i < gameOriginData.length; i += 4) {this.gameData.push([...gameOriginData.slice(i, i + 4)])
}
//输出数据是
//gameData=>
[['1','.','2','.'],['2','3','.','4'],['.','2','3','1'],['.','1','4','2'],
]

此时的数据就如同初级的4*4宫格数独了,但是我们还需要区分常量和变量,点的是可以切换数据的,带数字的则是引导常量。其次,还需要有标记功能在单个宫格内。

const kk = []for (let i = 0; i < this.gameData.length; i++) {kk[i] = []for (let j = 0; j < this.gameData[i].length; j++) {kk[i].push({id: this.gameData[i][j] == '.' ? '.' : parseInt(this.gameData[i][j]),marked: [],key: this.gameData[i][j] == '.' ? 0 : -1,//0则代表可以更改的值,-1代表定值不能改变})}}this.userMap = kk
//输出的数据结构是
//userMap =>
[[{id:1,key:-1,marked:[]},{id:'.',key:0,marked:[]},{id:2,key:-1,marked:[]},{id:'.',key:0,marked:[]},],[{id:2,key:-1,marked:[]},{id:3,key:-1,marked:[]},{id:'.',key:0,marked:[]},{id:4,key:-1,marked:[]},],[{id:'.',key:0,marked:[]},{id:2,key:-1,marked:[]},{id:3,key:-1,marked:[]},{id:1,key:-1,marked:[]},],[{id:'.',key:0,marked:[]},{id:1,key:-1,marked:[]},{id:4,key:-1,marked:[]},{id:2,key:0,marked:[]},]
]

此时则可以渲染棋盘了

html部分

<view class="qiPan"><view class="noticeView"><view v-for="(line, i) in userMap" :key="i" class="line"><viewv-for="(block, j) in line":key="j":class="{borderGreen: checkCurrent(i, j),block9: mapSku > 2,block4: mapSku == 2,}":style="[getBlockStyle(j, i)]"><viewv-if="block.key == -1":style="[getBlockStyleNpc(j, i)]":class="{textWrong: hitSame(i, j),textGrey: !hitSame(i, j),}">{{ block.id }}</view><viewv-else-if="block.key > 0"class="handleAction":class="{textWrong: hitSame(i, j),textGreen: !hitSame(i, j),rockStart: hitSame(i, j),}"@tap="blockClick(i, j)">{{ block.key }}</view><!-- 此处为空白宫格,可以点击 --><view v-else class="handleAction" @tap="blockClick(i, j)"></view></view></view>
</view>

js部分

//this.mapSku为2 则是2*2宫格 3则是3*3宫格
// 点击得当前宫格checkCurrent(i, j) {const result = this.touchCurrent[0] == i && this.touchCurrent[1] == jreturn result},
//当前定值的宫格cssgetBlockStyleNpc(i, j) {return {background: '#fffae1',width: '100%',height: '100%','border-top-left-radius': i == 0 && j == 0 ? '10rpx' : '0rpx','border-top-right-radius': j == 0 && i == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-left-radius':i == 0 && j == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-right-radius':i == this.mapSku * this.mapSku - 1 && j == this.mapSku * this.mapSku - 1? '10rpx': '0rpx',}},
//核心算法:判断是否存在同行同列或同单元格一致的用户填入数据hitSame(i, j) {const needNum = this.userMap[i][j].key >= 0 ? this.userMap[i][j].key : this.userMap[i][j].id// //求左上角的点const block_x = parseInt(i / this.mapSku) * this.mapSkuconst block_y = parseInt(j / this.mapSku) * this.mapSkuif (needNum == 0) return falsefor (let k = 0; k < this.mapSku * this.mapSku; k++) {//行let theNum = this.userMap[i][k].key >= 0 ? this.userMap[i][k].key : this.userMap[i][k].idif (theNum == needNum && theNum > 0 && j != k) return true//列theNum = this.userMap[k][j].key >= 0 ? this.userMap[k][j].key : this.userMap[k][j].idif (theNum == needNum && theNum > 0 && i != k) return true//单元格内const thex = block_x + parseInt(k % this.mapSku)const they = block_y + parseInt(k / this.mapSku)theNum =this.userMap[thex][they].key >= 0? this.userMap[thex][they].key: this.userMap[thex][they].idif (theNum == needNum && theNum > 0 && !(i == thex && j == they)) {return true}}return false},// 所有宫格宽高getBlockSize(val) {let result = 0if (val) {result = parseInt((680 + 4) / (this.mapSku * this.mapSku)) - 8} else {result = parseInt((680 + 4) / (this.mapSku * this.mapSku))}return result},// 设置棋盘宫内div的边框getBlockStyle(i, j) {return {width: this.getBlockSize() + 'rpx',height: this.getBlockSize() + 'rpx','over-flow': 'hidden','line-height': this.getBlockSize('lh') + 'rpx',// background: '#f8e7a4','border-top-left-radius': i == 0 && j == 0 ? '10rpx' : '0rpx','border-top-right-radius': j == 0 && i == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-left-radius':i == 0 && j == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-right-radius':i == this.mapSku * this.mapSku - 1 && j == this.mapSku * this.mapSku - 1? '10rpx': '0rpx',borderLeft:i == 0? '#ae7a36 4rpx solid': i % this.mapSku == 0? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',borderRight:i == this.mapSku * this.mapSku - 1? '#ae7a36 4rpx solid': i % this.mapSku == this.mapSku - 1? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',borderTop:j == 0? '#ae7a36 4rpx solid': j % this.mapSku == 0? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',borderBottom:j == this.mapSku * this.mapSku - 1? '#ae7a36 4rpx solid': j % this.mapSku == this.mapSku - 1? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',}},

css部分

.qiPan {padding-top: 20rpx;.noticeView {margin: 0 auto;border-radius: 10rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;.line {display: flex;flex-direction: row;align-items: center;justify-content: center;.handleAction {width: 100%;height: 100%;position: relative;}.block4 {font-size: 68rpx;text-align: center;}.block9 {font-size: 50rpx;text-align: center;}}.textWrong {background-color: #f14e28 !important;color: #6c4e27 !important;}.textGreen {color: #519d07;}.textGrey {color: #6c4e27;}.borderGreen {border: 4rpx solid #73d217 !important;}.rockStart {animation: chanDong 1s linear;}@keyframes chanDong {5% {-webkit-transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -10deg);transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -10deg);}6%,8%,10%,12% {-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 10deg);transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 10deg);}7%,9%,11% {-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -10deg);transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -10deg);}13% {-webkit-transform: scale3d(1, 1, 1);transform: scale3d(1, 1, 1);}}}}

此时我们就完成了棋盘的开发。接下来需要底部的数字按钮和操作按钮

<viewclass="actionUl":style="{ 'justify-content': mapSku * mapSku <= 4 ? 'space-around' : 'start' }"><viewv-for="(item, index) in mapSku * mapSku":key="index":class="{actionLi4: mapSku * mapSku <= 4,actionLi9: mapSku * mapSku > 4,}"@click="actionChange(item + 1)">{{ item + 1 }}</view><viewclass="bt":style="{ 'margin-left': mapSku * mapSku <= 4 ? '' : '36rpx' }"@click="marked = !marked">
//marked为真则是标记模式<view class="word">{{ marked ? '填字' : '标记' }}</view></view><viewclass="bt":style="{ 'margin-left': mapSku * mapSku <= 4 ? '' : '36rpx' }"@click="deleteSudo()"><view class="word">删除</view></view></view>
.actionUl {display: flex;flex-direction: row;flex-wrap: wrap;width: 680rpx;margin: 0 auto;padding-top: 50rpx;position: relative;z-index: 10;.actionLi4 {width: 126rpx;height: 126rpx;border-radius: 40rpx;border: solid 5rpx #fd6f10;font-size: 61rpx;text-align: center;line-height: 126rpx;font-weight: bold;cursor: pointer;margin-bottom: 20rpx;}.actionLi9:nth-child(7) {margin-right: 0;}.actionLi9 {width: 86rpx;margin-right: (78/6) + rpx;height: 86rpx;background-color: #ffab51;border-radius: 30rpx;border: solid 4rpx #fd6f10;font-size: 46rpx;text-align: center;line-height: 79rpx;font-weight: bold;cursor: pointer;margin-bottom: 20rpx;}.bt {width: 206rpx;height: 90rpx;border-radius: 24rpx;font-size: 34rpx;display: flex;flex-direction: row;align-items: center;justify-content: center;border: solid 5rpx #000000;text-align: center;line-height: 56rpx;cursor: pointer;position: relative;.icon {width: 34rpx;height: 34rpx;margin-right: 10rpx;}.word {padding-left: 10rpx;font-size: 34rpx;font-weight: bold;}}}

首先点击数字按钮,将数字action存储到data中,再宫格,获取[i,j]也就是坐标。再对数值的正确度进行判断。

// 方块点击事件
blockClick(i, j) {this.touchCurrent = [i, j]
},// 点击下方数字按钮async actionChange(val) {const that = thisif (this.touchCurrent.length == 0) {this.$tips.toast('请先选择方格')return false}const i = this.touchCurrent[0]const j = this.touchCurrent[1]this.action = valif (this.marked) {//此时为标记模式const io = this.userMap[i][j].marked.findIndex((value, index, arr) => {return value == val})if (io < 0) {this.userMap[i][j].marked.push(val)} else {this.userMap[i][j].marked.splice(io, 1)}this.$forceUpdate()return false}if (this.userMap[i][j].key != -1) {if (this.userMap[i][j].id != this.action) {this.userMap[i][j].key = parseInt(this.action)}this.$forceUpdate()}setTimeout(function () {if (that.hitSame(i, j)) {that.userMap[i][j].key = 0}}, 3000)//结果判断let canPass = truefor (let m = 0; m < this.mapSku * this.mapSku; m++) {for (let n = 0; n < this.mapSku * this.mapSku; n++) {if (this.hitSame(m, n) || this.userMap[m][n].key == 0) {canPass = falsebreak}}}if (canPass) {//游戏闯关成功,调用提交接口uni.showModal({content: '成功',showCancel: false,})// 弹窗提示}},

点击底部的数字,会首先判断是否标记模式,标记模式则会将数字push到该宫格内的marked中。否则则会判断userMap[i][j].key是否不为-1(非定值),然后再将action赋值给userMap[i][j].key。顶部的textWrong则会判断是否正确,错误则标红并伴有回弹动画。之后actionChange中会重置userMap[i][j].key为0;

下面贴出完整代码

<template><view class="allPage"><view class="page"><view class="qiPan"><view class="noticeView"><view v-for="(line, i) in userMap" :key="i" class="line"><viewv-for="(block, j) in line":key="j":class="{borderGreen: checkCurrent(i, j),block9: mapSku > 2,block4: mapSku == 2,}":style="[getBlockStyle(j, i)]"><viewv-if="block.key == -1":style="[getBlockStyleNpc(j, i)]":class="{textWrong: hitSame(i, j),textGrey: !hitSame(i, j),}">{{ block.id }}</view><viewv-else-if="block.key > 0"class="handleAction":class="{textWrong: hitSame(i, j),textGreen: !hitSame(i, j),rockStart: hitSame(i, j),}"@tap="blockClick(i, j)">{{ block.key }}</view><!-- 此处为空白宫格,可以点击 --><view v-else class="handleAction" @tap="blockClick(i, j)"><marked:width="getBlockSize()":list="block.marked":marked="marked":action="action":map-sku="mapSku"/></view></view></view></view></view><viewclass="actionUl":style="{ 'justify-content': mapSku * mapSku <= 4 ? 'space-around' : 'start' }"><viewv-for="(item, index) in mapSku * mapSku":key="index":class="{actionLi4: mapSku * mapSku <= 4,actionLi9: mapSku * mapSku > 4,}"@click="actionChange(item + 1)">{{ item + 1 }}</view><viewclass="bt":style="{ 'margin-left': mapSku * mapSku <= 4 ? '' : '36rpx' }"@click="marked = !marked"><view class="word">{{ marked ? '填字' : '标记' }}</view></view><viewclass="bt":style="{ 'margin-left': mapSku * mapSku <= 4 ? '' : '36rpx' }"@click="deleteSudo()"><view class="word">删除</view></view></view></view></view>
</template><script>
import { mapState } from 'vuex'
import marked from './components/marked.vue' //标记
export default {name: '',components: {marked,},data() {return {list: '',gameData: [],userMap: [],mapSku: 2,touchCurrent: [],action: '',marked: false,}},onLoad() {this.initData()},methods: {// 方块点击事件blockClick(i, j) {this.touchCurrent = [i, j]},// 点击底部删除按钮deleteSudo() {const that = thisif (this.touchCurrent.length == 0) {this.$tips.toast('请先选择方格')return false}const i = this.touchCurrent[0]const j = this.touchCurrent[1]if (this.marked) {//当前标记方格清空this.userMap[i][j].marked = []return false}// 非标记模式 将当前宫格内的数值置空this.userMap[i][j].key = 0this.action = 0},// 点击下方数字按钮async actionChange(val) {const that = thisif (this.touchCurrent.length == 0) {this.$tips.toast('请先选择方格')return false}const i = this.touchCurrent[0]const j = this.touchCurrent[1]this.action = valif (this.marked) {//此时为标记模式const io = this.userMap[i][j].marked.findIndex((value, index, arr) => {return value == val})if (io < 0) {this.userMap[i][j].marked.push(val)} else {this.userMap[i][j].marked.splice(io, 1)}this.$forceUpdate()return false}if (this.userMap[i][j].key != -1) {if (this.userMap[i][j].id != this.action) {this.userMap[i][j].key = parseInt(this.action)}this.$forceUpdate()}setTimeout(function () {if (that.hitSame(i, j)) {that.userMap[i][j].key = 0}}, 3000)//结果判断let canPass = truefor (let m = 0; m < this.mapSku * this.mapSku; m++) {for (let n = 0; n < this.mapSku * this.mapSku; n++) {if (this.hitSame(m, n) || this.userMap[m][n].key == 0) {canPass = falsebreak}}}if (canPass) {//游戏闯关成功,调用提交接口uni.showModal({content: '成功',showCancel: false,})// 弹窗提示}},// 初始化游戏async initData() {await this.loadData()},async loadData() {const gameOriginData = '1.2.23.4.231.142'for (let i = 0; i < gameOriginData.length; i += 4) {this.gameData.push([...gameOriginData.slice(i, i + 4)])}const kk = []for (let i = 0; i < this.gameData.length; i++) {kk[i] = []for (let j = 0; j < this.gameData[i].length; j++) {kk[i].push({id: this.gameData[i][j] == '.' ? '.' : parseInt(this.gameData[i][j]),marked: [],key: this.gameData[i][j] == '.' ? 0 : -1,})}}this.userMap = kk},// 点击得当前宫格checkCurrent(i, j) {const result = this.touchCurrent[0] == i && this.touchCurrent[1] == jreturn result},getBlockStyleNpc(i, j) {return {background: '#fffae1',width: '100%',height: '100%','border-top-left-radius': i == 0 && j == 0 ? '10rpx' : '0rpx','border-top-right-radius': j == 0 && i == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-left-radius':i == 0 && j == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-right-radius':i == this.mapSku * this.mapSku - 1 && j == this.mapSku * this.mapSku - 1? '10rpx': '0rpx',}},hitSame(i, j) {// // 判断是否存在同行同列或同单元格一致的用户填入数据const needNum = this.userMap[i][j].key >= 0 ? this.userMap[i][j].key : this.userMap[i][j].id// //求左上角的点const block_x = parseInt(i / this.mapSku) * this.mapSkuconst block_y = parseInt(j / this.mapSku) * this.mapSkuif (needNum == 0) return falsefor (let k = 0; k < this.mapSku * this.mapSku; k++) {//行let theNum = this.userMap[i][k].key >= 0 ? this.userMap[i][k].key : this.userMap[i][k].idif (theNum == needNum && theNum > 0 && j != k) return true//列theNum = this.userMap[k][j].key >= 0 ? this.userMap[k][j].key : this.userMap[k][j].idif (theNum == needNum && theNum > 0 && i != k) return true//单元格内const thex = block_x + parseInt(k % this.mapSku)const they = block_y + parseInt(k / this.mapSku)theNum =this.userMap[thex][they].key >= 0? this.userMap[thex][they].key: this.userMap[thex][they].idif (theNum == needNum && theNum > 0 && !(i == thex && j == they)) {return true}}return false},// 宫格宽高getBlockSize(val) {let result = 0if (val) {result = parseInt((680 + 4) / (this.mapSku * this.mapSku)) - 8} else {result = parseInt((680 + 4) / (this.mapSku * this.mapSku))}return result},// 设置棋盘宫内div的边框getBlockStyle(i, j) {return {width: this.getBlockSize() + 'rpx',height: this.getBlockSize() + 'rpx','over-flow': 'hidden','line-height': this.getBlockSize('lh') + 'rpx',// background: '#f8e7a4','border-top-left-radius': i == 0 && j == 0 ? '10rpx' : '0rpx','border-top-right-radius': j == 0 && i == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-left-radius':i == 0 && j == this.mapSku * this.mapSku - 1 ? '10rpx' : '0rpx','border-bottom-right-radius':i == this.mapSku * this.mapSku - 1 && j == this.mapSku * this.mapSku - 1? '10rpx': '0rpx',borderLeft:i == 0? '#ae7a36 4rpx solid': i % this.mapSku == 0? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',borderRight:i == this.mapSku * this.mapSku - 1? '#ae7a36 4rpx solid': i % this.mapSku == this.mapSku - 1? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',borderTop:j == 0? '#ae7a36 4rpx solid': j % this.mapSku == 0? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',borderBottom:j == this.mapSku * this.mapSku - 1? '#ae7a36 4rpx solid': j % this.mapSku == this.mapSku - 1? '#ae7a36 2rpx solid': '#dab88a 1rpx solid',}},},
}
</script>
<style lang="scss" scoped>
.allPage {background: #ffe97e;min-height: 100vh;.page {position: relative;width: 100%;.qiPan {padding-top: 20rpx;.noticeView {margin: 0 auto;border-radius: 10rpx;display: flex;flex-direction: column;align-items: center;justify-content: center;.line {display: flex;flex-direction: row;align-items: center;justify-content: center;.handleAction {width: 100%;height: 100%;position: relative;}.block4 {font-size: 68rpx;text-align: center;}.block9 {font-size: 50rpx;text-align: center;}}.textWrong {background-color: #f14e28 !important;color: #6c4e27 !important;}.textGreen {color: #519d07;}.textGrey {color: #6c4e27;}.borderGreen {border: 4rpx solid #73d217 !important;}.rockStart {animation: chanDong 1s linear;}@keyframes chanDong {5% {-webkit-transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -10deg);transform: scale3d(1, 1, 1) rotate3d(0, 0, 1, -10deg);}6%,8%,10%,12% {-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 10deg);transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 10deg);}7%,9%,11% {-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -10deg);transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -10deg);}13% {-webkit-transform: scale3d(1, 1, 1);transform: scale3d(1, 1, 1);}}}}.actionUl {display: flex;flex-direction: row;flex-wrap: wrap;width: 680rpx;margin: 0 auto;padding-top: 50rpx;position: relative;z-index: 10;.actionLi4 {width: 126rpx;height: 126rpx;border-radius: 40rpx;border: solid 5rpx #fd6f10;font-size: 61rpx;text-align: center;line-height: 126rpx;font-weight: bold;cursor: pointer;margin-bottom: 20rpx;}.actionLi9:nth-child(7) {margin-right: 0;}.actionLi9 {width: 86rpx;margin-right: (78/6) + rpx;height: 86rpx;background-color: #ffab51;border-radius: 30rpx;border: solid 4rpx #fd6f10;font-size: 46rpx;text-align: center;line-height: 79rpx;font-weight: bold;cursor: pointer;margin-bottom: 20rpx;}.bt {width: 206rpx;height: 90rpx;border-radius: 24rpx;font-size: 34rpx;// color: #ffffff;display: flex;flex-direction: row;align-items: center;justify-content: center;border: solid 5rpx #000000;cursor: pointer;position: relative;.icon {width: 34rpx;height: 34rpx;margin-right: 10rpx;}.word {padding-left: 10rpx;font-size: 34rpx;font-weight: bold;}}}}
}
</style>

marked组件代码如下

<template><view class="marked" :style="{ padding: mapSku > 2 ? '4rpx' : '0rpx' }"><view class="markedLi" :style="{ 'margin-left': mapSku > 2 ? '6rpx' : '0rpx' }"><viewv-for="(item, index) in markedList":key="index"class="markedItem":style="[getBlockStyleMaked()]">{{ item }}</view></view></view>
</template><script>
export default {name: 'Marked',props: {mapSku: {type: Number,default: 2,},list: {type: Array,default: () => [],},action: {type: Number,default: 0,},marked: {type: Boolean,default: false,},width: {type: [Number, String],default: 0,},},data() {return {markedList: [],}},watch: {list: function (val) {this.markedList = val},},created() {console.log('width是', this.width)this.markedList = this.list},methods: {getBlockStyleMaked() {const number4 = parseInt((this.width - 20) / this.mapSku) + 'rpx'const number9 = parseInt((this.width - 36) / this.mapSku) + 'rpx'console.log('number4是', number4)return {'text-align': 'center','font-size': (this.mapSku > 2 ? 20 : 30) + 'rpx',width: this.mapSku > 2 ? number9 : number4,height: this.mapSku > 2 ? number9 : number4,'line-height': this.mapSku > 2 ? number9 : number4,}},},
}
</script><style scoped lang="scss">
.marked {width: 100%;height: 100%;display: flex;background: #f8e7a4;flex-direction: row;align-items: center;position: absolute;left: 0;top: 0;.markedLi {display: flex;flex-direction: row;flex-wrap: wrap;text-align: center;margin: 0 auto;}
}
</style>

创建数独小游戏uniapp/vue相关推荐

  1. Android Studio实现数独小游戏,休闲益智

    文章目录 一.项目概述 二.开发环境 三.详细设计 3.1 界面设计 3.2 逻辑设计 四.运行演示 五.源码获取 一.项目概述 数独是一种逻辑解谜游戏,它规则稍复杂,解题过程富有挑战性.本次安卓数独 ...

  2. matlab 版 数独小游戏 GUI界面设计

    近期,由于各种原因,接触到了matlab版的数独小游戏,需要做GUI界面.由于之前本科的时候自己也做过简单的界面涉及,就以为很简单,结果,piapia打脸.数独中的数字是在table中显示的,为了将题 ...

  3. C语言编写数独小游戏

    文章目录 1.前言 2.效果展示 3.代码 1.前言 这次数独小游戏的灵感来源于上次力扣做的题目,解数独.正好利用题目余热写了这一款小小游戏. 感兴趣的可以看看题目,哈哈 2.效果展示 3.代码 #p ...

  4. java手机小游戏源码_Java手机版数独小游戏(J2me)JAVA游戏源码下载

    数独游戏,相信朋友们都知道的,以前也经常玩的,用VB.VC++和Delphi版编写的都在网上宣布过,今天放出一个鉴于Java的J2me手机版的,大致看一下截图,这是在Java模拟机运行的界面,带有Ja ...

  5. python大作业数独_python做一个数独小游戏

    最近看了下python的一些知识,在这里记载一下. 1.首先是安装,在官网下载最新的版本3.6,安装的时候要注意在下面勾选上ADD TO PATH,安装的时候会自动写入到环境变量里面,如果没有勾选,可 ...

  6. android 数独小游戏

    偶然想起来写一个数独的小游戏自己没事的时候玩一玩,锻炼锻炼思路. 先上效果截图           数独生成的算法,参见博客:数独生成算法 数独游戏的最基础的在于生成数独,由于生成数独的算法运算问题, ...

  7. android+studio数独小游戏,‎App Store 上的“益智数独-每日一题挑战题,锻炼你的大脑”...

    2021年,数以百万计的人在玩数独游戏了,他们通过数独游戏不断训练自己的大脑,2022年,通过数独游戏来训练自己大脑的人可能达破千万人次,你准备好了吗? 这是一款免费的数独游戏,里面包含多个难度级别, ...

  8. 独数游戏android程序,Android 数独小游戏

    先看看效果图 sudoku-o3.gif 数独设计思路 先看布局,我们可以看到数独由9x9的格子组成,每个格子中间有一个数字. Cell (单个格子.android 中我们可以先用TextView代替 ...

  9. 怀念童年,推箱子小游戏(vue版本)

    前言 最近都没有怎么写过文章,都断更很久了吧.学习前端一年多,快两年了,学习的热情相比一开始,自我感觉没有变化多少,但是 学习的动力却好像时有时无.就好像是没了目标一样,不知道自己现在应该学些什么,从 ...

  10. c++数独小游戏3.3

    好久没更新它了. 1:增加了看时间功能和完成上次未完成的游戏功能 2:上次为完成如果这次也没完成会消失. 3:修改了很多细节,修复了很多bug(真的,快累死我了) 4:不知道为什么,未完成的游戏不能存 ...

最新文章

  1. ICMP报文的格式和种类
  2. 干货 | 杨文韬:秘B类App如何手持大型武器还能高速奔跑
  3. php 分类代码,php无限分类的图文代码介绍
  4. 在hibernate框架中配置显示sql语句
  5. 路由器-配置(思科)
  6. 430单片机实现三人投票表决器_关于STC51下载器串口免冷启动简单方案
  7. 190123每日一句
  8. arcgis中将地理坐标转换为投影坐标 / 经纬度坐标转换
  9. Node.js学习笔记--进阶之路
  10. 常用排序:冒泡排序与快速排序详解,看完这篇就够了!风马博客
  11. Practical_RichFaces要点Chapter11
  12. 阿拉伯文变形规范,阿拉伯语变形规则,阿拉伯文组合规则
  13. Hadoop笔记02-Hadoop-HDFS
  14. MES系统功能助力注塑行业降本增效
  15. opencv调用basler简单示例
  16. vue 修复ie浏览器兼容性bug
  17. SQL批量快速替换文章标题关键词的方法语法 快速批量替换某个词技巧
  18. python语言的变量随时命名随时_模拟试卷C
  19. 微信小程序实现左滑删除
  20. 杭州,一个闻名遐迩的江南古城

热门文章

  1. 正点原子STM32F103学习笔记(二)
  2. docker镜像下载的网站
  3. plsqldev1105_x64与instantclient_11_2配置使用
  4. 《About Face 3:交互设计精髓》读书笔记(一)
  5. mysql mm keeplive_mysql +keeplive
  6. linux 内核编程视频
  7. 解决tar.bz2解压报错
  8. 51c语言编程入门教程,51单片机C语言入门教程
  9. 中值滤波器和双边滤波器(python实现)
  10. flink的测试sql怎么测试呢,不能每次都使用jar测试吧,那么sqk-client就来了