logic.c

来自「Many C samples. It is a good sample for 」· C语言 代码 · 共 45 行

C
45
字号
/* Bai tap 1_86 - Tro choi Logic */
#include <conio.h>
#include <dos.h>
#include <string.h>
#include <stdlib.h>
#include<stdio.h>
int day[7] = {-1,-1,-1,-1,-1,-1,-1};
int sonhap[4];
int somay[4];
int solanthu;
int timthay;

void khoitao()
{
  char tieude[] = "L O G I C    G A M E";
  int j, i, dich;
  textmode(C40);
  clrscr();
  textcolor(YELLOW);
  dich = (40 - strlen(tieude)) / 2;
  for (i=strlen(tieude)-1; i>=0; i--)
  {
    movetext(1,3,39,3,2,3);
    gotoxy(1,3);
    putch(tieude[i]);
    delay(40);
  }
  for (i=1; i<=dich; i++)
  {
    movetext(1,3,39,3,2,3);
    gotoxy(1,3);
    putch(' ');
    delay(40);
  }
  randomize();
  for (i=0; i<4; i++)
  {
    do {
      j = random(6)+1;
    } while (day[j] != -1);
    day[j] = i;
    somay[i] = j;
   // printf ("%d",&j);
  }
  gotoxy(14,5);         cprintf("赏屯屯脱屯屯屯

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?