⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roichu.c

📁 Many C samples. It is a good sample for students to learn C language.
💻 C
字号:
/* Chuong trinh lam roi chu mot cach ngau nhien */
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <dos.h>

char far *video;

void main()
{
  unsigned x, y, offset;
  char c;

  video = (char far *)MK_FP(0xB800, 0);
  randomize();
  do {
    x = random(80);
    y = random(25);
    offset = (y*80 + x) * 2;
    if (video[offset] != 32)
    {
       c = video[offset];
       while (video[offset + 160] == 32 && y<24)
       {
         video[offset] = 32;
         y++ ;
         offset = (y*80 + x) * 2;
         video[offset] = c;
         delay(50);
       }
    }
  } while (!kbhit());
}

⌨️ 快捷键说明

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