非常好用,
废话不多说(我猜你们也是直接复制粘贴的),直接上代码:
#include<iostream>
#include "stdio.h"
#include "conio.h"
#include <conio.h>
#include<ctime>
#include <windows.h>
using namespace std;
int fdx,fdy;
int length=3;
int speed=300;
void gotoxy(int x,int y) //控制光标坐标
{
COORD pos;
pos.X = x;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void print_noodle()//打印边框
{
for(int i=1;i<=21;i++)//左右边框
{
gotoxy(29,i);
cout<<"#";
gotoxy(81,i);
cout<<"#";
gotoxy(83,10);
cout<<"当前长度:";
gotoxy(83,11);
cout<<"目标长度:29";
gotoxy(83,12);
cout<<"当前速度:";
}
for(int i=30;i<81;i++)//上下边框
{
</