using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
for (int r = 0; r < 10; r++)
{
string line = (r / 4).ToString() + " " + (r >> 2).ToString() + " ";
{
int R = r / 4; if (r % 4 == 1) R++;
int G = r / 4; if (r % 4 == 2) G++;
int B = r / 4; if (r % 4 == 3) B++;
line += R.ToString() + G.ToString() + B.ToString() + " ";
}
{
int R = r >> 2; if ((r & 0x3) == 1) R++;
int G = r >> 2; if ((r & 0x3) == 2) G++;
int B = r >> 2; if ((r & 0x3) == 3) B++;
line += R.ToString() + G.ToString() + B.ToString() + " ";
}
{
int R = r / 4 + (r + 3) % 4 / 3;
int G = r / 4 + (r + 2) % 4 / 3;
int B = r / 4 + (r + 1) % 4 / 3;
line += R.ToString() + G.ToString() + B.ToString() + " ";
}
{
int R = r >> 2 + ((r + 3) & 0x03) / 3;
int G = r >> 2 + ((r + 2) & 0x03) / 3;
int B = r >> 2 + ((r + 1) & 0x03) / 3;
line += R.ToString() + G.ToString() + B.ToString() + Environment.NewLine;
}
textBox1.AppendText(line);
}
}
}
}