fork 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.Net;
  8. using System.Text;
  9. using System.Text.RegularExpressions;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12.  
  13. namespace ThreadMovement
  14. {
  15. public partial class Form1 : Form
  16. {
  17. List<List<string>> qu = new List<List<string>>();
  18. bool working = false;
  19. Point mp = new Point(-1, -1);
  20.  
  21. public Form1()
  22. {
  23. InitializeComponent();
  24. }
  25.  
  26. private void Form1_Load(object sender, EventArgs e)
  27. {
  28. }
  29.  
  30. private async void timer1_Tick(object sender, EventArgs e)
  31. {
  32. if (working) return;
  33. working = true;
  34. var url = "https://h...content-available-to-author-only...h.net/livejupiter/subject.txt";
  35. byte[] data;
  36. using (var wc = new WebClient())
  37. {
  38. data = await wc.DownloadDataTaskAsync(new Uri(url));
  39. }
  40. var text = Encoding.GetEncoding("Shift-JIS").GetString(data);
  41. var rawList = text.Trim().Split('\n');
  42. var list = rawList.Select(line => WebUtility.HtmlDecode(line.Split(new[] { "<>" }, StringSplitOptions.None)[1].Split('\t')[0].Trim())).ToList();
  43. list.RemoveRange(list.Count - 3, 3);
  44. qu.Add(list);
  45. if (qu.Count > 200)
  46. {
  47. qu.RemoveAt(0);
  48. }
  49. working = false;
  50. PictureBox1.Invalidate();
  51. }
  52.  
  53. private void PictureBox1_MouseMove(object sender, MouseEventArgs e)
  54. {
  55. var p = e.Location;
  56. var yi = p.Y / 5;
  57. var xi = p.X / 5;
  58. label1.Text = xi + "," + yi;
  59. if (xi < qu.Count)
  60. {
  61. if (yi < qu[xi].Count)
  62. {
  63. label1.Text = qu[xi][yi];
  64. }
  65. else
  66. {
  67. label1.Text = "";
  68. }
  69. }
  70. else
  71. {
  72. label1.Text = "";
  73. }
  74. mp = p;
  75. PictureBox1.Invalidate();
  76. }
  77.  
  78. private void PictureBox1_MouseLeave(object sender, EventArgs e)
  79. {
  80. label1.BackColor = Color.Transparent;
  81. mp = new Point(-1, -1);
  82. PictureBox1.Invalidate();
  83. }
  84.  
  85. private void PictureBox1_MouseDown(object sender, MouseEventArgs e)
  86. {
  87. var p = e.Location;
  88. var yi = p.Y / 5;
  89. var xi = p.X / 5;
  90. label1.Text = xi + "," + yi;
  91. if (xi < qu.Count)
  92. {
  93. if (yi < qu[xi].Count)
  94. {
  95. var text = " " + qu[xi][yi].Split(new[] { ' ', ' ' }, StringSplitOptions.RemoveEmptyEntries)[0];
  96. if (textBox1.Text.Contains(text))
  97. {
  98. textBox1.Text = textBox1.Text.Replace(text, "");
  99. }
  100. else
  101. {
  102. textBox1.Text += text;
  103. }
  104. }
  105. }
  106. }
  107.  
  108. private void PictureBox1_Paint(object sender, PaintEventArgs e)
  109. {
  110. e.Graphics.Clear(Color.White);
  111. for (var h = 0; h < qu.Count; h++)
  112. {
  113. for (var i = 0; i < qu[h].Count; i++)
  114. {
  115. var title = qu[h][i];
  116. var sum = title.Aggregate(0, (_r, c) => c + _r);
  117. var col = Color.FromArgb(((byte)(sum * 1242135)), ((byte)(sum * 3215125)), ((byte)(sum * 12542)));
  118. if (textBox1.Text != "")
  119. {
  120. col = Color.FromArgb(col.R / 2, col.G / 2, col.B / 2);
  121. }
  122. if (textBox1.Text != "" && textBox1.Text.Split(new[] { ' ', ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList().Any(word => title.Contains(word)))
  123. {
  124. col = Color.Gold;
  125. }
  126. using (var b = new SolidBrush(col))
  127. {
  128. e.Graphics.FillRectangle(b, h * 5, i * 5, 5, 5);
  129. }
  130. }
  131. }
  132. e.Graphics.DrawLine(Pens.Gray, 0, mp.Y, PictureBox1.Width, mp.Y);
  133. e.Graphics.DrawLine(Pens.Gray, mp.X, 0, mp.X, PictureBox1.Height);
  134. }
  135. }
  136. }
  137.  
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 `System.Data' assembly reference?
prog.cs(11,22): error CS0234: The type or namespace name `Forms' does not exist in the namespace `System.Windows'. Are you missing `System.Windows.Forms' assembly reference?
prog.cs(15,34): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
prog.cs(53,59): error CS0246: The type or namespace name `MouseEventArgs' could not be found. Are you missing an assembly reference?
prog.cs(85,59): error CS0246: The type or namespace name `MouseEventArgs' could not be found. Are you missing an assembly reference?
prog.cs(108,55): error CS0246: The type or namespace name `PaintEventArgs' could not be found. Are you missing an assembly reference?
Compilation failed: 6 error(s), 0 warnings
stdout
Standard output is empty