diff WindowsOnly/WinScript/test.txt @ 0:db40c85cad7a default tip

upload sample source
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Mon, 09 May 2011 03:11:59 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WindowsOnly/WinScript/test.txt	Mon May 09 03:11:59 2011 +0900
@@ -0,0 +1,45 @@
+// テスト
+
+void UpdateColor(int &r, int &g, int &b)
+{
+	r += 4;
+	if (r > 255) {
+		r = 0;
+		g += 4;
+		if (g > 255) {
+			g = 0;
+			b += 4;
+			if (b > 255)
+				b = 0;
+		}
+	}
+}
+
+int main()
+{
+	int i, j;
+	int r, g, b;
+
+	r = 0;
+	g = 0;
+	b = 0;
+
+	for (j=0; j<100; j+=1) {
+		for (i=0; i<640; i+=2) {
+			UpdateColor(r, g, b);
+			SetColor(r, g, b);
+			MoveTo(i, 0);
+			LineTo(640 - i, 480);
+		}
+		for (i=0; i<480; i+=2) {
+			UpdateColor(r, g, b);
+			SetColor(r, g, b);
+			MoveTo(0, 480 - i);
+			LineTo(640, i);
+		}
+		Refresh();
+	}
+	MessageBox("テスト", "終了しました");
+
+	return 0;
+}