C# 实现的美丽的夜空屏幕保护程序

From , 5 Years ago, written in C#, viewed 208 times.
URL https://pastebin.vip/view/475d6631
  1. using System;
  2. class set_cursor2
  3. {
  4.  
  5. int lastnum;
  6.  
  7. private int RandomNumber(int min, int max)
  8. {
  9.    Random random = new Random();
  10.    lastnum = random.Next(min, max);
  11.  
  12.    if (lastnum%3 == 0 || lastnum%4==0 )
  13.    {
  14.       lastnum = random.Next(min, max);
  15.    }
  16.  
  17.    if (lastnum%5 == 0 || lastnum%6==0 || lastnum%7==0 )
  18.    {
  19.       lastnum = random.Next(min, max);
  20.    }
  21.  
  22.    return lastnum;
  23. }
  24.  
  25. static void Main(string[] args)
  26. {
  27.    set_cursor2 obj = new set_cursor2();
  28.    int lastrow,lastcol;
  29.    int i,j,t;
  30.    Console.ResetColor();
  31.    Console.Clear();
  32.    Console.SetWindowSize(100,50);
  33.    Console.BufferHeight = 500;
  34.    Console.BufferWidth = 200;
  35.    Console.CursorSize = 50;
  36.    Console.CursorVisible = true;
  37.  
  38.    i = 1;
  39.    do
  40.    {    
  41.       j=  obj.RandomNumber(1,99);
  42.       Console.CursorLeft = j;
  43.       lastcol = j;
  44.       j=  obj.RandomNumber(1,49);
  45.       lastrow = j;
  46.       Console.CursorTop = j;
  47.       if (i%3 == 0)
  48.         Console.ForegroundColor = ConsoleColor.White;
  49.       else if (i%4 == 0)
  50.          Console.ForegroundColor = ConsoleColor.Cyan;
  51.       else
  52.          Console.ForegroundColor = ConsoleColor.DarkBlue;
  53.  
  54.       if ((i+j) % 2 == 0 || (i+j) % 3 == 0  || (i+j) % 5 == 0) 
  55.          Console.WriteLine(" ");
  56.       else
  57.          Console.WriteLine(".");
  58.  
  59. //    Console.WriteLine(". {0} {1}",lastrow,lastcol);
  60.       for(t=0;t<19999999;t++);
  61.       i++;
  62.    }
  63.  
  64.    while (i<=10000);   
  65.    Console.WriteLine("\n\n Finish");
  66.    Console.ReadLine();
  67. }
  68.  
  69. }
  70. //csharp/4201

Reply to "C# 实现的美丽的夜空屏幕保护程序"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website