fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Drawing;
  7.  
  8. namespace Screen_Virus
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. Random random = new Random();
  15.  
  16. Pen pen = new Pen(Color.Black);
  17.  
  18. List<Point> left = new List<Point>();
  19.  
  20. Graphics graphics = Graphics.FromHwnd(IntPtr.Zero);
  21.  
  22. Point size = new Point((int)graphics.Clip.GetBounds(graphics).X, (int)graphics.Clip.GetBounds(graphics).Y);
  23.  
  24. bool[,] filled = new bool[size.X, size.Y];
  25.  
  26. for (int x = 0; x < size.X; ++x)
  27. for (int y = 0; y < size.Y; ++y)
  28. {
  29. filled[x, y] = false;
  30.  
  31. left.Add(new Point(x, y));
  32. }
  33.  
  34.  
  35.  
  36.  
  37. while (true)
  38. {
  39. System.Threading.Thread.Sleep(50);
  40.  
  41. Point removePoint = left[(int) (random.NextDouble() * left.Count)];
  42.  
  43. filled[removePoint.X, removePoint.Y] = true;
  44.  
  45. left.Remove(removePoint);
  46.  
  47. for (int x = 0; x < size.X; ++x)
  48. for (int y = 0; y < size.Y; ++y)
  49. if (filled[x, y])
  50. graphics.DrawRectangle(pen, new Rectangle(x, y, 1, 1));
  51.  
  52. }
  53.  
  54.  
  55.  
  56.  
  57. }
  58. }
  59. }
  60.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(5,24): error CS0234: The type or namespace name `Tasks' does not exist in the namespace `System.Threading'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty