Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 36 lines (31 sloc) 1.195 kb
bbe99c6 @alloy Make examples work when using the gem.
alloy authored
1 # If using the gem, replace with:
9e29295 @floere + big refactor, again
authored
2 #
bbe99c6 @alloy Make examples work when using the gem.
alloy authored
3 # require 'rubygems'
4 # require 'james'
e39cf5d @floere + dialogue redesign, + audio recognition
authored
5 require File.expand_path '../../lib/james', __FILE__
8b8ee9c @floere + moved old project
authored
6
73a8e97 @floere + Renamed to use American spelling – James is slightly irked, but agrees...
authored
7 # Time dialog by Florian Hanke.
9e29295 @floere + big refactor, again
authored
8 #
9 # This is a very simple James example.
10 #
11 # It has only one state, :joke, and a single
12 # entry/hook phrase, "Tell me a joke"
13 #
14 # Improve the jokes ;)
8b8ee9c @floere + moved old project
authored
15 #
d0aafbe @floere + Renamed James.use_dialog -> James.dialog
authored
16 James.dialog do
00ab79d + james
Florian Hanke authored
17
5d75520 @floere + nicefied input flow
authored
18 hear 'Tell me a joke' => :joke
8b8ee9c @floere + moved old project
authored
19
8f5f6f3 @floere + rewrite #4
authored
20 state :joke do
21 jokes = [
00ab79d + james
Florian Hanke authored
22 'What do you say to a cow that crosses in front of your car? ... ... Mooove over.',
23 'What\'s green, has 6 legs, and if it falls out of a tree and lands on you, it could hurt? ... ... A pool table.',
24 'What is the one thing everybody in the world is doing at the same time? ... ... Growing older.',
25 'How many hamburgers can you eat on an empty stomach? ... ... Only one or part of one, because after that, your stomach is no longer empty.',
26 'What\'s the difference between a jeweler and a jailor? ... ... One sells watches, and the other watches cells.',
27 'What did the elephant say to the naked man? ... ... How do you breathe through that thing?'
8f5f6f3 @floere + rewrite #4
authored
28 ]
9e29295 @floere + big refactor, again
authored
29 hear 'Another one'
8f5f6f3 @floere + rewrite #4
authored
30 into do
9e29295 @floere + big refactor, again
authored
31 "#{jokes[rand(jokes.size)]} ... ... ... Ha ha ha."
8f5f6f3 @floere + rewrite #4
authored
32 end
00ab79d + james
Florian Hanke authored
33 end
8b8ee9c @floere + moved old project
authored
34
bbe99c6 @alloy Make examples work when using the gem.
alloy authored
35 end
Something went wrong with that request. Please try again.