- 博客(14)
- 资源 (1)
- 收藏
- 关注
原创 c++编写推箱子
#include <iostream>#include <stdio.h> #include <conio.h>#include<stdlib.h> int map[9][11] = { {0,1,1,1,1,1,1,1,1,1,0}, //0代表空地 {0,1,0,0,0,1,0,0,0,1,0}, //1代表墙 {0,1,0,4,4,4,4,4,0,1,0}, //3代表目的地 {0,1,0,4,0,4,0,4,0
2022-03-05 16:05:13
200
原创 c++编写极快贪吃蛇
#include <windows.h>#include <stdlib.h>#include <conio.h>#include <time.h>#include <cstring>#include <cstdio>#include <iostream>#define N 22using namespace std;int gameover;int x1, y1111; // 随机出米int
2022-01-18 17:00:56
173
原创 C\C++编写贪吃蛇
文章目录一、贪吃蛇是什么?二、编写贪吃蛇三、游戏代码一、贪吃蛇是什么?贪吃蛇是一款经典的休闲游戏。有PC和手机等多平台版本,既简单又耐玩。玩家在游戏通过控制蛇头方向吃道具,从而使得蛇变得越来越长。二、编写贪吃蛇该游戏学要学会编写左右控制键,吃食物身体长度+1,将蛇头和蛇身以及米打印在控制台上,判断游戏的输赢。游戏设置等级,空格键暂停三、游戏代码#include <windows.h>#include <stdlib.h>#include <conio.h>
2021-08-25 17:01:01
589
原创 c++编写矿井逃生
#include <time.h>#include <math.h>#include <stdio.h>#include<graphics.h>// 定义常量#define PI 3.141592653589 // 圆周率#define UNIT_GROUND 0 // 表示地面#define UNIT_WALL 1 // 表示墙#define LIGHT_A PI / 3 // 灯光的角度范围#define L
2021-08-15 15:45:48
335
原创 c++编写推箱子
#include<stdio.h>#include<conio.h>#include<windows.h>int map[9][11] = {{0,1,1,1,1,1,1,1,1,1,0},{0,1,0,0,0,1,0,0,0,1,0},{0,1,0,0,3,0,0,0,0,1,0},{0,1,0,3,0,3,3,3,0,1,1},{0,1,0,0,0,2,0,0,0,0,1},{1,1,0,0,1,1,1,0,3,0,1},{1,0,4,4,0,4,
2021-08-14 12:47:46
405
原创 c++编写九九乘法口诀表
#include <stdio.h>int main(){int i, j, k;for (i = 1; i <= 9; i++){for (j = 1; j <= i; j++){k = i * j;printf("%d * %d = %d “, i, j, k);}printf(”\n");}printf(“断点停在这”);return 0;}
2021-07-13 15:34:47
727
1
原创 c++编写打字游戏
//https://gitee.com/devcpp/cgames anbangli@foxmail.com GNU GPL v3/https://gitee.com/devcpp/cgames anbangli@foxmail.com GNU GPL v3//cgame2-2(type).cpp 字符横向移动的打字游戏#include #include #include #include <windows.h> //非标准库函数 Sleep 所需的
2021-05-09 20:35:48
872
原创 pygame编写贪吃蛇
import pygame, sys, random, timefrom pygame.locals import * # 从pygame模块导入常用的函数和常量#定义颜色变量black_colour = pygame.Color(28, 56, 20)white_colour = pygame.Color(255, 144, 20)red_colour = pygame.Color(255,34 , 20)grey_colour = pygame.Color(150, 150, 150)#
2020-10-05 19:36:19
319
1
原创 python编写九九乘法口诀表
# -*- coding: UTF-8 -*- # Filename : test.py # author by : www.runoob.com # 九九乘法表for i in range(1, 10): for j in range(1, i+1): print('{}x{}={}\t'.format(j, i, i*j), end='') print()
2020-10-03 12:40:02
322
2
原创 python编写猫和老鼠
import turtle as timport randomimport timeimport simpleaudio as sa#记录时间start_time = time.time()used_time = 0#3. 创建背景game = t.Screen()game.setup(700, 700)game.bgpic(‘bg.gif’)t.tracer(3)#4. 创建猫咪cat = t.Turtle()cat.color(‘yellow’)cat.shapesize(
2020-08-21 13:38:14
3207
原创 用Python编写打乒乓小游戏
import turtle as t#2. 创建背景game = t.Screen()game.title("打乒乓小游戏")game.bgcolor("black")game.setup(800,600)game.tracer(0)#3. 创建球拍xm = t.Turtle()xm.ht() #先隐藏xm.up()xm.speed(0)xm.color('yellow')xm.shape('square')xm.shapesize(5, 1)xm.goto(-350, 0
2020-08-19 12:14:01
869
原创 python编写打乒乓球小游戏
import turtle as t**#2. 创建背景**game = t.Screen()game.title("打乒乓")game.bgcolor("black")game.setup(800,600)game.tracer(0)#3. 创建球拍xm = t.Turtle()xm.ht() #先隐藏xm.up()xm.speed(0)xm.color('yellow')xm.shape('square')xm.shapesize(5, 1)xm.goto(-350,
2020-08-19 11:42:02
1599
1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人