先看代码:
闪屏特效(不建议尝逝):
#include<bits/stdc++.h>
#include<time.h>
#include<stdio.h>
#include<conio.h>
using namespace std;
int main() {
char a;
while(a!=27) {
a=0;
if(_kbhit()) {
a=getch();
if(_kbhit())a=getch();
}
if(rand()%16==0) {
if(rand()%16==0)system("color 00");
if(rand()%16==1)system("color 10");
if(rand()%16==2)system("color 20");
if(rand()%16==3)system("color 30");
if(rand()%16==4)system("color 40");
if(rand()%16==5)system("color 50");
if(rand()%16==6)system("color 60");
if(rand()%16==7)system("color 70");
if(rand()%16==8)system("color 80");
if(rand()%16==9)system("color 90");
if(rand()%16==10)system("color A0");
if(rand()%16==11)system("color B0");
if(rand()%16==12)system("color C0");
if(rand()%16==13)system("color D0");
if(rand()%16==14)system("color E0");
if(rand()%16==15)system("color F0");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 01");
if(rand()%16==1)system("color 11");
if(rand()%16==2)system("color 21");
if(rand()%16==3)system("color 31");
if(rand()%16==4)system("color 41");
if(rand()%16==5)system("color 51");
if(rand()%16==6)system("color 61");
if(rand()%16==7)system("color 71");
if(rand()%16==8)system("color 81");
if(rand()%16==9)system("color 91");
if(rand()%16==10)system("color A1");
if(rand()%16==11)system("color B1");
if(rand()%16==12)system("color C1");
if(rand()%16==13)system("color D1");
if(rand()%16==14)system("color E1");
if(rand()%16==15)system("color F1");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 02");
if(rand()%16==1)system("color 12");
if(rand()%16==2)system("color 22");
if(rand()%16==3)system("color 32");
if(rand()%16==4)system("color 42");
if(rand()%16==5)system("color 52");
if(rand()%16==6)system("color 62");
if(rand()%16==7)system("color 72");
if(rand()%16==8)system("color 82");
if(rand()%16==9)system("color 92");
if(rand()%16==10)system("color A2");
if(rand()%16==11)system("color B2");
if(rand()%16==12)system("color C2");
if(rand()%16==13)system("color D2");
if(rand()%16==14)system("color E2");
if(rand()%16==15)system("color F2");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 03");
if(rand()%16==1)system("color 13");
if(rand()%16==2)system("color 23");
if(rand()%16==3)system("color 33");
if(rand()%16==4)system("color 43");
if(rand()%16==5)system("color 53");
if(rand()%16==6)system("color 63");
if(rand()%16==7)system("color 73");
if(rand()%16==8)system("color 83");
if(rand()%16==9)system("color 93");
if(rand()%16==10)system("color A3");
if(rand()%16==11)system("color B3");
if(rand()%16==12)system("color C3");
if(rand()%16==13)system("color D3");
if(rand()%16==14)system("color E3");
if(rand()%16==15)system("color F3");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 04");
if(rand()%16==1)system("color 14");
if(rand()%16==2)system("color 24");
if(rand()%16==3)system("color 34");
if(rand()%16==4)system("color 44");
if(rand()%16==5)system("color 54");
if(rand()%16==6)system("color 64");
if(rand()%16==7)system("color 74");
if(rand()%16==8)system("color 84");
if(rand()%16==9)system("color 94");
if(rand()%16==10)system("color A4");
if(rand()%16==11)system("color B4");
if(rand()%16==12)system("color C4");
if(rand()%16==13)system("color D4");
if(rand()%16==14)system("color E4");
if(rand()%16==15)system("color F4");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 05");
if(rand()%16==1)system("color 15");
if(rand()%16==2)system("color 25");
if(rand()%16==3)system("color 35");
if(rand()%16==4)system("color 45");
if(rand()%16==5)system("color 55");
if(rand()%16==6)system("color 65");
if(rand()%16==7)system("color 75");
if(rand()%16==8)system("color 85");
if(rand()%16==9)system("color 95");
if(rand()%16==10)system("color A5");
if(rand()%16==11)system("color B5");
if(rand()%16==12)system("color C5");
if(rand()%16==13)system("color D5");
if(rand()%16==14)system("color E5");
if(rand()%16==15)system("color F5");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 06");
if(rand()%16==1)system("color 16");
if(rand()%16==2)system("color 26");
if(rand()%16==3)system("color 36");
if(rand()%16==4)system("color 46");
if(rand()%16==5)system("color 56");
if(rand()%16==6)system("color 66");
if(rand()%16==7)system("color 76");
if(rand()%16==8)system("color 86");
if(rand()%16==9)system("color 96");
if(rand()%16==10)system("color A6");
if(rand()%16==11)system("color B6");
if(rand()%16==12)system("color C6");
if(rand()%16==13)system("color D6");
if(rand()%16==14)system("color E6");
if(rand()%16==15)system("color F6");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 07");
if(rand()%16==1)system("color 17");
if(rand()%16==2)system("color 27");
if(rand()%16==3)system("color 37");
if(rand()%16==4)system("color 47");
if(rand()%16==5)system("color 57");
if(rand()%16==6)system("color 67");
if(rand()%16==7)system("color 77");
if(rand()%16==8)system("color 87");
if(rand()%16==9)system("color 97");
if(rand()%16==10)system("color A7");
if(rand()%16==11)system("color B7");
if(rand()%16==12)system("color C7");
if(rand()%16==13)system("color D7");
if(rand()%16==14)system("color E7");
if(rand()%16==15)system("color F7");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 08");
if(rand()%16==1)system("color 18");
if(rand()%16==2)system("color 28");
if(rand()%16==3)system("color 38");
if(rand()%16==4)system("color 48");
if(rand()%16==5)system("color 58");
if(rand()%16==6)system("color 68");
if(rand()%16==7)system("color 78");
if(rand()%16==8)system("color 88");
if(rand()%16==9)system("color 98");
if(rand()%16==10)system("color A8");
if(rand()%16==11)system("color B8");
if(rand()%16==12)system("color C8");
if(rand()%16==13)system("color D8");
if(rand()%16==14)system("color E8");
if(rand()%16==15)system("color F8");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 09");
if(rand()%16==1)system("color 19");
if(rand()%16==2)system("color 29");
if(rand()%16==3)system("color 39");
if(rand()%16==4)system("color 49");
if(rand()%16==5)system("color 59");
if(rand()%16==6)system("color 69");
if(rand()%16==7)system("color 79");
if(rand()%16==8)system("color 89");
if(rand()%16==9)system("color 99");
if(rand()%16==10)system("color A9");
if(rand()%16==11)system("color B9");
if(rand()%16==12)system("color C9");
if(rand()%16==13)system("color D9");
if(rand()%16==14)system("color E9");
if(rand()%16==15)system("color F9");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0A");
if(rand()%16==1)system("color 1A");
if(rand()%16==2)system("color 2A");
if(rand()%16==3)system("color 3A");
if(rand()%16==4)system("color 4A");
if(rand()%16==5)system("color 5A");
if(rand()%16==6)system("color 6A");
if(rand()%16==7)system("color 7A");
if(rand()%16==8)system("color 8A");
if(rand()%16==9)system("color 9A");
if(rand()%16==10)system("color AA");
if(rand()%16==11)system("color BA");
if(rand()%16==12)system("color CA");
if(rand()%16==13)system("color DA");
if(rand()%16==14)system("color EA");
if(rand()%16==15)system("color FA");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0B");
if(rand()%16==1)system("color 1B");
if(rand()%16==2)system("color 2B");
if(rand()%16==3)system("color 3B");
if(rand()%16==4)system("color 4B");
if(rand()%16==5)system("color 5B");
if(rand()%16==6)system("color 6B");
if(rand()%16==7)system("color 7B");
if(rand()%16==8)system("color 8B");
if(rand()%16==9)system("color 9B");
if(rand()%16==10)system("color AB");
if(rand()%16==11)system("color BB");
if(rand()%16==12)system("color CB");
if(rand()%16==13)system("color DB");
if(rand()%16==14)system("color EB");
if(rand()%16==15)system("color FB");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0C");
if(rand()%16==1)system("color 1C");
if(rand()%16==2)system("color 2C");
if(rand()%16==3)system("color 3C");
if(rand()%16==4)system("color 4C");
if(rand()%16==5)system("color 5C");
if(rand()%16==6)system("color 6C");
if(rand()%16==7)system("color 7C");
if(rand()%16==8)system("color 8C");
if(rand()%16==9)system("color 9C");
if(rand()%16==10)system("color AC");
if(rand()%16==11)system("color BC");
if(rand()%16==12)system("color CC");
if(rand()%16==13)system("color DC");
if(rand()%16==14)system("color EC");
if(rand()%16==15)system("color FC");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0D");
if(rand()%16==1)system("color 1D");
if(rand()%16==2)system("color 2D");
if(rand()%16==3)system("color 3D");
if(rand()%16==4)system("color 4D");
if(rand()%16==5)system("color 5D");
if(rand()%16==6)system("color 6D");
if(rand()%16==7)system("color 7D");
if(rand()%16==8)system("color 8D");
if(rand()%16==9)system("color 9D");
if(rand()%16==10)system("color AD");
if(rand()%16==11)system("color BD");
if(rand()%16==12)system("color CD");
if(rand()%16==13)system("color DD");
if(rand()%16==14)system("color ED");
if(rand()%16==15)system("color FD");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0E");
if(rand()%16==1)system("color 1E");
if(rand()%16==2)system("color 2E");
if(rand()%16==3)system("color 3E");
if(rand()%16==4)system("color 4E");
if(rand()%16==5)system("color 5E");
if(rand()%16==6)system("color 6E");
if(rand()%16==7)system("color 7E");
if(rand()%16==8)system("color 8E");
if(rand()%16==9)system("color 9E");
if(rand()%16==10)system("color AE");
if(rand()%16==11)system("color BE");
if(rand()%16==12)system("color CE");
if(rand()%16==13)system("color DE");
if(rand()%16==14)system("color EE");
if(rand()%16==15)system("color FE");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0F");
if(rand()%16==1)system("color 1F");
if(rand()%16==2)system("color 2F");
if(rand()%16==3)system("color 3F");
if(rand()%16==4)system("color 4F");
if(rand()%16==5)system("color 5F");
if(rand()%16==6)system("color 6F");
if(rand()%16==7)system("color 7F");
if(rand()%16==8)system("color 8F");
if(rand()%16==9)system("color 9F");
if(rand()%16==10)system("color AF");
if(rand()%16==11)system("color BF");
if(rand()%16==12)system("color CF");
if(rand()%16==13)system("color DF");
if(rand()%16==14)system("color EF");
if(rand()%16==15)system("color FF");
}
}
return 0;
}
模拟:
#include<bits/stdc++.h>
#include<time.h>
using namespace std;
int main() {
system("color 02");
while(1){
cout<<rand()%2<<" ";
}
return 0;
}
控制:
#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
using namespace std;
int x=100,y=100,b=0;
char a=0;
int main() {
while(a!=27) {
a=0;
if(_kbhit()) {
a=getch();
if(_kbhit()) {
a=getch();
}
if(a==72&&b>0) {
y-=2;
}
if(a==80&&b>0) {
y+=2;
}
if(a=='K'&&b>0) {
x-=2;
}
if(a=='M'&&b>0) {
x+=2;
}
if(a=='?') {
b++;
}
}
SetCursorPos(x,y);
}
return 0;
}
结合起来,就十分好玩了,请看1.0:
#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
using namespace std;
int x=100,y=100,b=0;
char a=0;
int main() {
while(a!=27) {
a=0;
cout<<rand()%2<<" ";
if(_kbhit()) {
a=getch();
if(_kbhit()) {
a=getch();
}
if(a==72&&b>0) {
y-=2;
}
if(a==80&&b>0) {
y+=2;
}
if(a=='K'&&b>0) {
x-=2;
}
if(a=='M'&&b>0) {
x+=2;
}
if(a=='?') {
b++;
}
}
SetCursorPos(x,y);
if(rand()%16==0) {
if(rand()%16==0)system("color 00");
if(rand()%16==1)system("color 10");
if(rand()%16==2)system("color 20");
if(rand()%16==3)system("color 30");
if(rand()%16==4)system("color 40");
if(rand()%16==5)system("color 50");
if(rand()%16==6)system("color 60");
if(rand()%16==7)system("color 70");
if(rand()%16==8)system("color 80");
if(rand()%16==9)system("color 90");
if(rand()%16==10)system("color A0");
if(rand()%16==11)system("color B0");
if(rand()%16==12)system("color C0");
if(rand()%16==13)system("color D0");
if(rand()%16==14)system("color E0");
if(rand()%16==15)system("color F0");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 01");
if(rand()%16==1)system("color 11");
if(rand()%16==2)system("color 21");
if(rand()%16==3)system("color 31");
if(rand()%16==4)system("color 41");
if(rand()%16==5)system("color 51");
if(rand()%16==6)system("color 61");
if(rand()%16==7)system("color 71");
if(rand()%16==8)system("color 81");
if(rand()%16==9)system("color 91");
if(rand()%16==10)system("color A1");
if(rand()%16==11)system("color B1");
if(rand()%16==12)system("color C1");
if(rand()%16==13)system("color D1");
if(rand()%16==14)system("color E1");
if(rand()%16==15)system("color F1");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 02");
if(rand()%16==1)system("color 12");
if(rand()%16==2)system("color 22");
if(rand()%16==3)system("color 32");
if(rand()%16==4)system("color 42");
if(rand()%16==5)system("color 52");
if(rand()%16==6)system("color 62");
if(rand()%16==7)system("color 72");
if(rand()%16==8)system("color 82");
if(rand()%16==9)system("color 92");
if(rand()%16==10)system("color A2");
if(rand()%16==11)system("color B2");
if(rand()%16==12)system("color C2");
if(rand()%16==13)system("color D2");
if(rand()%16==14)system("color E2");
if(rand()%16==15)system("color F2");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 03");
if(rand()%16==1)system("color 13");
if(rand()%16==2)system("color 23");
if(rand()%16==3)system("color 33");
if(rand()%16==4)system("color 43");
if(rand()%16==5)system("color 53");
if(rand()%16==6)system("color 63");
if(rand()%16==7)system("color 73");
if(rand()%16==8)system("color 83");
if(rand()%16==9)system("color 93");
if(rand()%16==10)system("color A3");
if(rand()%16==11)system("color B3");
if(rand()%16==12)system("color C3");
if(rand()%16==13)system("color D3");
if(rand()%16==14)system("color E3");
if(rand()%16==15)system("color F3");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 04");
if(rand()%16==1)system("color 14");
if(rand()%16==2)system("color 24");
if(rand()%16==3)system("color 34");
if(rand()%16==4)system("color 44");
if(rand()%16==5)system("color 54");
if(rand()%16==6)system("color 64");
if(rand()%16==7)system("color 74");
if(rand()%16==8)system("color 84");
if(rand()%16==9)system("color 94");
if(rand()%16==10)system("color A4");
if(rand()%16==11)system("color B4");
if(rand()%16==12)system("color C4");
if(rand()%16==13)system("color D4");
if(rand()%16==14)system("color E4");
if(rand()%16==15)system("color F4");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 05");
if(rand()%16==1)system("color 15");
if(rand()%16==2)system("color 25");
if(rand()%16==3)system("color 35");
if(rand()%16==4)system("color 45");
if(rand()%16==5)system("color 55");
if(rand()%16==6)system("color 65");
if(rand()%16==7)system("color 75");
if(rand()%16==8)system("color 85");
if(rand()%16==9)system("color 95");
if(rand()%16==10)system("color A5");
if(rand()%16==11)system("color B5");
if(rand()%16==12)system("color C5");
if(rand()%16==13)system("color D5");
if(rand()%16==14)system("color E5");
if(rand()%16==15)system("color F5");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 06");
if(rand()%16==1)system("color 16");
if(rand()%16==2)system("color 26");
if(rand()%16==3)system("color 36");
if(rand()%16==4)system("color 46");
if(rand()%16==5)system("color 56");
if(rand()%16==6)system("color 66");
if(rand()%16==7)system("color 76");
if(rand()%16==8)system("color 86");
if(rand()%16==9)system("color 96");
if(rand()%16==10)system("color A6");
if(rand()%16==11)system("color B6");
if(rand()%16==12)system("color C6");
if(rand()%16==13)system("color D6");
if(rand()%16==14)system("color E6");
if(rand()%16==15)system("color F6");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 07");
if(rand()%16==1)system("color 17");
if(rand()%16==2)system("color 27");
if(rand()%16==3)system("color 37");
if(rand()%16==4)system("color 47");
if(rand()%16==5)system("color 57");
if(rand()%16==6)system("color 67");
if(rand()%16==7)system("color 77");
if(rand()%16==8)system("color 87");
if(rand()%16==9)system("color 97");
if(rand()%16==10)system("color A7");
if(rand()%16==11)system("color B7");
if(rand()%16==12)system("color C7");
if(rand()%16==13)system("color D7");
if(rand()%16==14)system("color E7");
if(rand()%16==15)system("color F7");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 08");
if(rand()%16==1)system("color 18");
if(rand()%16==2)system("color 28");
if(rand()%16==3)system("color 38");
if(rand()%16==4)system("color 48");
if(rand()%16==5)system("color 58");
if(rand()%16==6)system("color 68");
if(rand()%16==7)system("color 78");
if(rand()%16==8)system("color 88");
if(rand()%16==9)system("color 98");
if(rand()%16==10)system("color A8");
if(rand()%16==11)system("color B8");
if(rand()%16==12)system("color C8");
if(rand()%16==13)system("color D8");
if(rand()%16==14)system("color E8");
if(rand()%16==15)system("color F8");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 09");
if(rand()%16==1)system("color 19");
if(rand()%16==2)system("color 29");
if(rand()%16==3)system("color 39");
if(rand()%16==4)system("color 49");
if(rand()%16==5)system("color 59");
if(rand()%16==6)system("color 69");
if(rand()%16==7)system("color 79");
if(rand()%16==8)system("color 89");
if(rand()%16==9)system("color 99");
if(rand()%16==10)system("color A9");
if(rand()%16==11)system("color B9");
if(rand()%16==12)system("color C9");
if(rand()%16==13)system("color D9");
if(rand()%16==14)system("color E9");
if(rand()%16==15)system("color F9");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0A");
if(rand()%16==1)system("color 1A");
if(rand()%16==2)system("color 2A");
if(rand()%16==3)system("color 3A");
if(rand()%16==4)system("color 4A");
if(rand()%16==5)system("color 5A");
if(rand()%16==6)system("color 6A");
if(rand()%16==7)system("color 7A");
if(rand()%16==8)system("color 8A");
if(rand()%16==9)system("color 9A");
if(rand()%16==10)system("color AA");
if(rand()%16==11)system("color BA");
if(rand()%16==12)system("color CA");
if(rand()%16==13)system("color DA");
if(rand()%16==14)system("color EA");
if(rand()%16==15)system("color FA");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0B");
if(rand()%16==1)system("color 1B");
if(rand()%16==2)system("color 2B");
if(rand()%16==3)system("color 3B");
if(rand()%16==4)system("color 4B");
if(rand()%16==5)system("color 5B");
if(rand()%16==6)system("color 6B");
if(rand()%16==7)system("color 7B");
if(rand()%16==8)system("color 8B");
if(rand()%16==9)system("color 9B");
if(rand()%16==10)system("color AB");
if(rand()%16==11)system("color BB");
if(rand()%16==12)system("color CB");
if(rand()%16==13)system("color DB");
if(rand()%16==14)system("color EB");
if(rand()%16==15)system("color FB");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0C");
if(rand()%16==1)system("color 1C");
if(rand()%16==2)system("color 2C");
if(rand()%16==3)system("color 3C");
if(rand()%16==4)system("color 4C");
if(rand()%16==5)system("color 5C");
if(rand()%16==6)system("color 6C");
if(rand()%16==7)system("color 7C");
if(rand()%16==8)system("color 8C");
if(rand()%16==9)system("color 9C");
if(rand()%16==10)system("color AC");
if(rand()%16==11)system("color BC");
if(rand()%16==12)system("color CC");
if(rand()%16==13)system("color DC");
if(rand()%16==14)system("color EC");
if(rand()%16==15)system("color FC");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0D");
if(rand()%16==1)system("color 1D");
if(rand()%16==2)system("color 2D");
if(rand()%16==3)system("color 3D");
if(rand()%16==4)system("color 4D");
if(rand()%16==5)system("color 5D");
if(rand()%16==6)system("color 6D");
if(rand()%16==7)system("color 7D");
if(rand()%16==8)system("color 8D");
if(rand()%16==9)system("color 9D");
if(rand()%16==10)system("color AD");
if(rand()%16==11)system("color BD");
if(rand()%16==12)system("color CD");
if(rand()%16==13)system("color DD");
if(rand()%16==14)system("color ED");
if(rand()%16==15)system("color FD");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0E");
if(rand()%16==1)system("color 1E");
if(rand()%16==2)system("color 2E");
if(rand()%16==3)system("color 3E");
if(rand()%16==4)system("color 4E");
if(rand()%16==5)system("color 5E");
if(rand()%16==6)system("color 6E");
if(rand()%16==7)system("color 7E");
if(rand()%16==8)system("color 8E");
if(rand()%16==9)system("color 9E");
if(rand()%16==10)system("color AE");
if(rand()%16==11)system("color BE");
if(rand()%16==12)system("color CE");
if(rand()%16==13)system("color DE");
if(rand()%16==14)system("color EE");
if(rand()%16==15)system("color FE");
}
if(rand()%16==0) {
if(rand()%16==0)system("color 0F");
if(rand()%16==1)system("color 1F");
if(rand()%16==2)system("color 2F");
if(rand()%16==3)system("color 3F");
if(rand()%16==4)system("color 4F");
if(rand()%16==5)system("color 5F");
if(rand()%16==6)system("color 6F");
if(rand()%16==7)system("color 7F");
if(rand()%16==8)system("color 8F");
if(rand()%16==9)system("color 9F");
if(rand()%16==10)system("color AF");
if(rand()%16==11)system("color BF");
if(rand()%16==12)system("color CF");
if(rand()%16==13)system("color DF");
if(rand()%16==14)system("color EF");
if(rand()%16==15)system("color FF");
}
}
return 0;
}
注:所有程序按Esc键均可退出,按F5键可以解锁权限,目前仅限方向键移动鼠标