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.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18.  
  19. private void Form1_Load(object sender, EventArgs e)
  20. {
  21. for (int r = 0; r < 10; r++)
  22. {
  23. string line = (r / 4).ToString() + " " + (r >> 2).ToString() + " ";
  24. {
  25. int R = r / 4; if (r % 4 == 1) R++;
  26. int G = r / 4; if (r % 4 == 2) G++;
  27. int B = r / 4; if (r % 4 == 3) B++;
  28. line += R.ToString() + G.ToString() + B.ToString() + " ";
  29. }
  30. {
  31. int R = r >> 2; if ((r & 0x3) == 1) R++;
  32. int G = r >> 2; if ((r & 0x3) == 2) G++;
  33. int B = r >> 2; if ((r & 0x3) == 3) B++;
  34. line += R.ToString() + G.ToString() + B.ToString() + " ";
  35. }
  36. {
  37. int R = r / 4 + (r + 3) % 4 / 3;
  38. int G = r / 4 + (r + 2) % 4 / 3;
  39. int B = r / 4 + (r + 1) % 4 / 3;
  40. line += R.ToString() + G.ToString() + B.ToString() + " ";
  41. }
  42. {
  43. int R = r >> 2 + ((r + 3) & 0x03) / 3;
  44. int G = r >> 2 + ((r + 2) & 0x03) / 3;
  45. int B = r >> 2 + ((r + 1) & 0x03) / 3;
  46. line += R.ToString() + G.ToString() + B.ToString() + Environment.NewLine;
  47. }
  48. textBox1.AppendText(line);
  49. }
  50. }
  51. }
  52. }
  53.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty