fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication3
  12. {
  13. public partial class Form1 : Form
  14. {
  15.  
  16. public PictureBox[,] hairetu = new PictureBox[10, 20];
  17. public Form1()
  18. {
  19. Timer timer = new Timer();
  20. timer.Tick += new EventHandler(MyClock);
  21. timer.Interval = 1000;
  22. timer.Enabled = true; // timer.Start()と同じ
  23.  
  24. InitializeComponent();
  25. }
  26.  
  27. public void MyClock(object sender, EventArgs e)
  28. {
  29. bool chinko = true;
  30. for (int a = 0; a < 10; a++)
  31. {
  32. for (int b = 0; b < 20; b++)
  33. {
  34. if (hairetu[a, b] != null && hairetu[a, b].unko == true)
  35. {
  36. chinko = false;
  37. }
  38. }
  39. }
  40.  
  41. if (chinko)
  42. {
  43. Random rnd = new Random();
  44. int ransuu = rnd.Next(0, 9);
  45. hairetu[ransuu, 0] = new PictureBox();
  46. hairetu[ransuu, 0].Location = new Point(ransuu * 20, 20);
  47. hairetu[ransuu, 0].BackColor = Color.Red;
  48. hairetu[ransuu, 0].Size = new Size(20, 20);
  49. this.Controls.Add(hairetu[ransuu, 0]);
  50. }
  51. }
  52. }
  53. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(8,24): error CS0234: The type or namespace name `Tasks' does not exist in the namespace `System.Threading'. Are you missing an assembly reference?
prog.cs(9,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(16,9): error CS0246: The type or namespace name `PictureBox' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 4 error(s), 0 warnings
stdout
Standard output is empty