-
Notifications
You must be signed in to change notification settings - Fork 177
/
better-book.lic
28 lines (25 loc) · 796 Bytes
/
better-book.lic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
custom_require.call(%w[common])
class BetterBook
def initialize
start_book
end
def start_book
pages = []
DRC.bput('turn register to content', 'You flip', 'But a ')
fput('read register')
loop do
case get
when /(\d+) --/
pages << Regexp.last_match(1)
when /Maximum/
_respond(pages.map { |d| "<d cmd='turn register to page #{d}'>#{d}</d>" }.join(' '))
pages = []
when /You flip your deed register to page (\d+)/, /You think the item/
_respond("<d cmd='read register'>Read</d> <d cmd='tap register'>Pull</d> <d cmd='turn register to content'>Contents</d>")
when /You flip your deed register to the contents page/, /But a deed register/
fput('read register')
end
end
end
end
BetterBook.new