aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Readme2
-rwxr-xr-xforward-please24
-rw-r--r--level.rb6
3 files changed, 17 insertions, 15 deletions
diff --git a/Readme b/Readme
index 6e11399..902839b 100644
--- a/Readme
+++ b/Readme
@@ -1,3 +1,5 @@
"A Papers Please style game where you are a multi-layer switch desperately trying to stay relevant."
A Stupid Ideas game.
+
+h for help.
diff --git a/forward-please b/forward-please
index 69f5dd1..dcd7f75 100755
--- a/forward-please
+++ b/forward-please
@@ -11,8 +11,6 @@ end
$level = $levels.shift
-puts $level.description
-
def help
puts <<~EOF
Commands:
@@ -20,7 +18,6 @@ def help
h: this help
c: click on
d: show the level description
- i: show the interfaces
a: show the click frames and actions
q: quit
EOF
@@ -34,15 +31,19 @@ end
def clickactions
puts "Click #{$click}:"
- puts "Frames:"
+
+ puts " Interfaces:"
+ puts " #{$level.interfaces.join(", ")}"
+
+ puts " Frames:"
$clickframes.each do |id, frame|
- puts " #{id}: #{frame.description} from Interface #{frame.iface}"
+ puts " #{id}: #{frame.description} from Interface #{frame.iface}"
end
i = 1
- puts "Actions:"
+ puts " Actions:"
$instructions.each do |instr|
- puts " #{i}: Forward frame #{instr[0]} to interface #{instr[1].iface}"
+ puts " #{i}: Forward frame #{instr[0]} to interface #{instr[1].iface}"
end
end
@@ -82,7 +83,9 @@ def click
puts "Demo all done"
exit 0
end
+ puts
puts $level.description
+ puts
end
$clickframes = $level.generate
@@ -102,8 +105,6 @@ def handle(cmd)
end
when ?d
puts $level.description
- when ?i
- puts $level.interfaces
when ?a
clickactions
when ?c
@@ -113,9 +114,12 @@ def handle(cmd)
end
end
-$clickframes = $level.generate
+puts $level.description
+puts
+$clickframes = $level.generate
clickactions
+
loop do
print ">: "
handle(gets.strip)
diff --git a/level.rb b/level.rb
index 9a34afc..4cb5986 100644
--- a/level.rb
+++ b/level.rb
@@ -8,9 +8,5 @@ class Level
self.instance_eval(&block)
end
- attr_reader :description, :clicks
-
- def interfaces
- (["Interfaces:"] + @@interfaces).join("\n ")
- end
+ attr_reader :description, :clicks, :interfaces
end