小游戏之猜箱子
选择箱子个数 ,交换次数 ,交换速度等,将球丢入到一个箱子中,然后开始随机交换箱子,猜出球的位置
源代码如下:
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <stdio.h>
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#define A 1664525
#define C 1013904223
#define M 4294967296UL
static unsigned seed = 1;
CHAR8 a[50][50]={"------",
"+ +",
"+ +",
"+ +",
"------"};
int c,n,sudu;
BOOLEAN k[200]={0,1,0,0,0,0,0,0,0,0};
void Sleep(int Count)
{
MicroSecondDelay(Count*1000);
}
void cls()
{
gST->ConOut->ClearScreen (gST->ConOut);
}
void xy(int y,int x)
{
gST->ConOut->SetCursorPosition ( gST->ConOut, x, y);
}
void out(int x,int y,BOOLEAN t)
{
if (t)
for (int i=0;i<5;i++,x++)
{
xy(x,y);
//DEBUG((DEBUG_ERROR, "x:%d y:%d.\n" ,x,y));
for (int j=0;j<6;j++)
{
Print (L"%c",(unsigned short )a[i][j]);