summaryrefslogtreecommitdiff
path: root/subwayis
diff options
context:
space:
mode:
Diffstat (limited to 'subwayis')
-rw-r--r--subwayis/init_code.lua75
-rw-r--r--subwayis/nodes/(-649,9,-283).lua3
-rw-r--r--subwayis/nodes/(-662,8,-296).lua3
-rw-r--r--subwayis/nodes/(21,-2,34).lua1
-rw-r--r--subwayis/nodes/(8,-2,48).lua1
5 files changed, 83 insertions, 0 deletions
diff --git a/subwayis/init_code.lua b/subwayis/init_code.lua
new file mode 100644
index 0000000..6d3dabe
--- /dev/null
+++ b/subwayis/init_code.lua
@@ -0,0 +1,75 @@
+function F.lookahead_3(dep3t, arr2t, dep2t, arr1t, dep1t)
+if event.ext_int then
+ if event.message=="dep3" then
+ time2 = dep3t
+ elseif event.message=="arr2" then
+ time2 = arr2t
+ elseif event.message=="dep2" then
+ time1 = dep2t
+ time2 = nil
+ elseif event.message=="arr1" then
+ time1 = arr1t
+ elseif event.message=="dep1" then
+ time0 = dep1t
+ time1 = nil
+ else
+ time0 = nil
+ end
+ tmseq = ((tmseq or 0)+1)%10
+elseif event.int and event.message==tmseq then
+ if time0 then time0 = time0 - 5 end
+ if time1 then time1 = time1 - 5 end
+ if time2 then time2 = time2 - 5 end
+end
+if (time0 or time1 or time2) and (time0 or time1 or time2)>=0 then
+ digiline_send("disp", F.make_big_number_str(time0 or time1 or time2))
+ if (not event.int or event.message==tmseq) then
+ interrupt(5,tmseq)
+ end
+else
+ digiline_send("disp", " | | ----- -----")
+end
+digiline_send("dinf", (time2 or "nil") .. " | "..(time1 or "nil") .. " | "..(time0 or "nil") .. " | ")
+end
+
+
+local function t(tab)
+ for i=0,9 do
+local s = ""
+for p=1,5 do
+ s=s..(string.sub(tab[i], p, p)=="#" and "8" or "~")
+end
+tab[i] = s
+ end
+return tab
+end
+local digitl1 = t({
+[0] = "#####", [1] = " #", [2] = "#####", [3] = "#####", [4] = "# #",
+[5] = "#####", [6] = "#####", [7] = "#####", [8] = "#####", [9] = "#####"})
+local digitl2 = t({
+[0] = "# #", [1] = " #", [2] = " #", [3] = " #", [4] = "# #",
+[5] = "# ", [6] = "# ", [7] = " #", [8] = "# #", [9] = "# #"})
+local digitl3 = t({
+[0] = "# #", [1] = " #", [2] = "#####", [3] = "#####", [4] = "#####",
+[5] = "#####", [6] = "#####", [7] = " #", [8] = "#####", [9] = "#####"})
+local digitl4 = t({
+[0] = "# #", [1] = " #", [2] = "# ", [3] = " #", [4] = " #",
+[5] = " #", [6] = "# #", [7] = " #", [8] = "# #", [9] = " #"})
+local digitl5 = t({
+[0] = "#####", [1] = " #", [2] = "#####", [3] = "#####", [4] = " #",
+[5] = "#####", [6] = "#####", [7] = " #", [8] = "#####", [9] = "#####"})
+
+function F.make_big_number_str(num)
+local d1 = tonumber(string.sub(num,1,1))
+local d2 = tonumber(string.sub(num,2,2))
+if not d2 then
+d2 = d1
+d1 = 0
+end
+if not d1 then d1=0 end
+return "" .. digitl1[d1] .. " " .. digitl1[d2] .. " | "
+ .. digitl2[d1] .. " " .. digitl2[d2] .. " | "
+ .. digitl3[d1] .. " " .. digitl3[d2] .. " | "
+ .. digitl4[d1] .. " " .. digitl4[d2] .. " | "
+ .. digitl5[d1] .. " " .. digitl5[d2] .. ""
+end \ No newline at end of file
diff --git a/subwayis/nodes/(-649,9,-283).lua b/subwayis/nodes/(-649,9,-283).lua
new file mode 100644
index 0000000..cfefe4c
--- /dev/null
+++ b/subwayis/nodes/(-649,9,-283).lua
@@ -0,0 +1,3 @@
+if nil then
+F.lookahead_3(75, 55, 45, 30, 20)
+end \ No newline at end of file
diff --git a/subwayis/nodes/(-662,8,-296).lua b/subwayis/nodes/(-662,8,-296).lua
new file mode 100644
index 0000000..8504ca9
--- /dev/null
+++ b/subwayis/nodes/(-662,8,-296).lua
@@ -0,0 +1,3 @@
+if nil then
+F.lookahead_3(90, 70, 60, 30, 20)
+end \ No newline at end of file
diff --git a/subwayis/nodes/(21,-2,34).lua b/subwayis/nodes/(21,-2,34).lua
new file mode 100644
index 0000000..ce2b54b
--- /dev/null
+++ b/subwayis/nodes/(21,-2,34).lua
@@ -0,0 +1 @@
+interrupt_pos(POS(-14,3,4), "dep1") \ No newline at end of file
diff --git a/subwayis/nodes/(8,-2,48).lua b/subwayis/nodes/(8,-2,48).lua
new file mode 100644
index 0000000..9fef105
--- /dev/null
+++ b/subwayis/nodes/(8,-2,48).lua
@@ -0,0 +1 @@
+interrupt_pos(POS(-14,3,4), "dep4") \ No newline at end of file