英語老師:你這語法也太糟糕了吧。
某帥男:報(bào)告~這是程序。
來,開始敲~
#include<gl/glut.h>
#include<stdio.h>
#include<stdlib.h>
#include<ctime>
static int LENGTH=20;
enum Color
{
BLACK,RED,GREEN,YELLOW
}
enum ConnectState
{
Not_Connected,Left_Connected,Right_Connected,Up_Connected,Down_Connected
}
enum GridState
{
EMPTY,CAPSULE,WARM
}
enum MarionState
{
WATE,ACT
}
class Diamonds
{
private:
int x,y;
int color;
int ConnectState;
public:
int getx()
{
return x;
}
int gety()
{
return y;
}
int getColor()
{
color=rand(RED,GREEN,YELLOW);
return color;
}
int getConnectState()
{
return ConnectState;
}
};
class Warm
{
private:
int x,y;
int color=rand(RED,GREEN,YELLOW);
public:
int getx()
{
return x;
}
int gety()
{
return y;
}
int getColor()
{
return color;
}
};
class Bottle //Bottle 類沒想明白呢,只知道開一個(gè)二圍數(shù)組,每個(gè)里面都放上小色塊。
{
private:
public:
};
int CapsuleMade() //膠囊就是這樣拼起來的,初始化了一下,但是感覺缺一些東西
{
Diamonds Capsule[2];
Capsule[0].x=Capsule[1].x-LENGTH;
Capsule[0].ConnectState=Right_Connected;
Capsule[1].ConnectState=Left_Connected;
}
今天的腦細(xì)胞已經(jīng)耗完了,等明天補(bǔ)充吧~~