当前位置:网站首页>Gobang interface of mobile console (C language)
Gobang interface of mobile console (C language)
2022-06-11 07:12:00 【lihongtao8209】
One 、 Outline design model
The plan design interface is shown in Figure 1 .
Two 、 Outline design description
- The vertical direction is from bottom to top , The scope is :1-F.
- The horizontal direction is marked from left to right , The scope is :A-O.
- The whole chessboard has 255 A place , For vacancy # Express .
3、 ... and 、 Program code
#include <stdio.h>
#include<conio.h>
char board[15][33];
void showboard();
void initboard();
void drawboard();
char seq();
int main(int argc, char** argv)
{
initboard();
showboard();
drawboard();
return 0;
}
char seq(int n)
{
char ch;
switch(n)
{
case 10:ch='A';break;
case 11:ch='B';break;
case 12:ch='C';break;
case 13:ch='D';break;
case 14:ch='E';break;
case 15:ch='F';break;
case 16:ch='G';break;
case 17:ch='H';break;
case 18:ch='I';break;
case 19:ch='J';break;
case 20:ch='K';break;
case 21:ch='L';break;
case 22:ch='M';break;
case 23:ch='N';break;
case 24:ch='O';break;
default: ch=n+'0';
}
return ch;
}
void showboard()
{
for(int i=0;i<15;i++)
{
board[i][0]=seq(15-i);
board[i][1]=' ';
for(int j=1;j<16;j++)
{
board[i][2*j]=' ';
board[i][2*j+1]='#';
}
}
}
void initboard()
{
for(int i=0;i<32;i++)
for(int j=0;j<32;j++)
board[i[j]=0;
}
void drawboard()
{
for(int k=0;k<15;k++)
printf("%s\n",board[k]);
printf("\n%s"," ");
for(int i=10;i<25;i++)
printf("%c ",seq(i));
}
Four 、 Program code description
1.board Two dimensional arrays have 15 That's ok 33 Column .
2.board The row index of the two-dimensional array is 0 To 14, Column index 0 To 32.
3.board Two dimensional array from 1 To 15 OK, No 0 Column store 0 To F character .
4.board Two dimensional array from 1 To 15 OK, No 1 Columns store empty characters .
5.board Two dimensional array from 1 To 15 OK, No 0 Column 、 The first 1 The columns are shown in the following figure :
0 Space
1 Space
2 Space
3 Space
4 Space
5 Space
6 Space
7 Space
8 Space
9 Space
A Space
B Space
C Space
D Space
E Space
F Space
边栏推荐
- Leetcode-647. Palindromic Substrings
- Education expert wangzhongze solves students' problems with one move
- Latex various arrows / arrows with text labels / variable length arrows
- Duality-Gated Mutual Condition Network for RGBT Tracking
- saltstack部署lnmp
- @JsonProperty注解
- Mistakes in Niuke JS exercise
- 顶流编辑器 Atom,将于 12 月 15 日退出历史舞台
- Cross-Modal Pattern-Propagation for RGB-T Tracking
- matplotlib的cmap
猜你喜欢
![[deploy private warehouse based on harbor] 4 push image to harbor](/img/af/8e28b229d94f3e6eab02308b69dc74.jpg)
[deploy private warehouse based on harbor] 4 push image to harbor
![[advanced concurrency] - thread pool summary](/img/69/dc8146dafc30f8a8efa012b67aa05c.png)
[advanced concurrency] - thread pool summary

生物序列智能分析平台blog(1)

The difference between arrow function and ordinary function

Senior openstacker - Bloomberg, vexxhost upgraded to gold member of openinfra Foundation

Leetcode-141. Linked List Cycle

教育专家王中泽老师一招解决学生问题
![[deploy private warehouse based on harbor] 3 deploy harbor](/img/cd/be68a430e86b4b23ad93b42a338f00.jpg)
[deploy private warehouse based on harbor] 3 deploy harbor

Shuttle container component

Listen to the left width of the browser to calculate the distance
随机推荐
Completed in May, 22
品牌定位个性六种形态及结论的重大意义
Analysis of key points and difficulties of ES6 promise source code
Whether the ZABBIX monitoring host is online
Experience record of rural housing integration script
Promise details
421. maximum XOR value of two numbers in the array
1190. invert the substring between each pair of parentheses
Leetcode-104. Maximum Depth of Binary Tree
Atomicinteger atomic operation class
Quality-aware Feature Aggregation Networkfor Robust RGBT Tracking
Transformer Tracking
Nodejs database (Part 2)
Leetcode-647. Palindromic Substrings
Cv2.rectangle() picture frame
教育专家王中泽老师一招解决学生问题
微信小程序开发(原生和uniapp)DOM标签对比介绍
Leetcode-104. Maximum Depth of Binary Tree
Biological sequence intelligent analysis platform blog (1)
农房一体脚本的心得记录