aboutsummaryrefslogtreecommitdiffstats
path: root/initrd
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2018-03-07 15:25:55 -0500
committerClyne Sullivan <tullivan99@gmail.com>2018-03-07 15:25:55 -0500
commita774e33ceff6c3eef02aad4f58a11c7e23ff62bb (patch)
tree36555d06322d4bea7ffe4bf572cf282db2989fcd /initrd
parent77338a6b34d6a164fc2f70e6d736eca8a5b7d251 (diff)
basic graphing
Diffstat (limited to 'initrd')
-rw-r--r--initrd/init38
-rw-r--r--initrd/init221
-rw-r--r--initrd/init31
3 files changed, 59 insertions, 1 deletions
diff --git a/initrd/init b/initrd/init
index 4351743..56e5212 100644
--- a/initrd/init
+++ b/initrd/init
@@ -1 +1,37 @@
-print "Hello, world!"
+func Fx
+ ret (arg0 * arg0)
+end
+
+# graph area
+set plotx 0
+set ploty 0
+set plotw 479
+set ploth 319
+
+# graph range
+set xmin (0 - 10)
+set xmax 10
+set ymin (0 - 10)
+set ymax 10
+
+set xinc (plotw / (xmax - xmin))
+set yinc (ploth / (ymax - ymin))
+
+# print axis
+line 240 0 240 319 32767
+line 0 160 479 160 32767
+
+# do function
+set x xmin
+set cx (plotx + (plotw / 2))
+set cy (ploty + (ploth / 2))
+do
+ Fx x > y
+ set y (0 - y)
+ if ((y > ymin) & (y < ymax))
+ pixel (cx + (x * xinc)) (cy + (y * yinc)) 511
+ end
+ set x (x + (1 / xinc))
+while (x < xmax)
+
+print "Done."
diff --git a/initrd/init2 b/initrd/init2
new file mode 100644
index 0000000..47dbae1
--- /dev/null
+++ b/initrd/init2
@@ -0,0 +1,21 @@
+do
+ getkey > input
+ print input
+ delay 1000
+while (1)
+
+#do
+# getkey > input
+# if (input & 4)
+# rand 479 > x
+# rand 319 > y
+# rand 479 > i
+# rand 319 > j
+# rand 32767 > purple
+#
+# line x y i j purple
+# end
+#while (1)
+#
+#print "done"
+
diff --git a/initrd/init3 b/initrd/init3
new file mode 100644
index 0000000..4351743
--- /dev/null
+++ b/initrd/init3
@@ -0,0 +1 @@
+print "Hello, world!"