J
jamison edmonds
Hello all
Still new to programing.=A0=20
I'm making a magic 8 ball clone, for fun and to learn by, console based for=
now.
=A0=20
***
I need a few good examples on how to detect if input has a question mark at=
the end (more than one example/explanation preferably.)=A0=20
So, I GETS a question in my .rb and if "string?" o.k. else I'd like to say,=
need a question with a ? mark at end please.
***
At <http://www.ruby-lang.org/en/>=20
[
Ruby is...=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 # Output "I love Ruby"
----------------=A0=A0=A0=A0=A0=A0=A0=A0=A0 say =3D "I love Ruby"
e pluribus =A0=A0=A0 =A0=A0=A0=A0=A0=A0 puts say
unum, and such=20
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 # Outpu=
t "I *LOVE* RUBY"
=A0=A0=A0 =A0=A0=A0 =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 say['love'] =3D "=
*love*"
=A0=A0=A0 =A0=A0=A0 =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 puts say.upcase
=A0
=A0=A0=A0 =A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Output "I *love* =
Ruby"
=A0=A0=A0 =A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0 # five times
=A0=A0=A0 =A0=A0=A0 =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 5.times { puts sa=
y }
]
I see I can brake string's into parts, this may help me rite?
Ruby rocks, thanks to all.
=0A=0A=0A
Still new to programing.=A0=20
I'm making a magic 8 ball clone, for fun and to learn by, console based for=
now.
***
I need a few good examples on how to detect if input has a question mark at=
the end (more than one example/explanation preferably.)=A0=20
So, I GETS a question in my .rb and if "string?" o.k. else I'd like to say,=
need a question with a ? mark at end please.
***
At <http://www.ruby-lang.org/en/>=20
[
Ruby is...=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 # Output "I love Ruby"
----------------=A0=A0=A0=A0=A0=A0=A0=A0=A0 say =3D "I love Ruby"
e pluribus =A0=A0=A0 =A0=A0=A0=A0=A0=A0 puts say
unum, and such=20
t "I *LOVE* RUBY"
=A0=A0=A0 =A0=A0=A0 =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 say['love'] =3D "=
*love*"
=A0=A0=A0 =A0=A0=A0 =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 puts say.upcase
=A0
=A0=A0=A0 =A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Output "I *love* =
Ruby"
=A0=A0=A0 =A0=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0=A0 # five times
=A0=A0=A0 =A0=A0=A0 =A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 5.times { puts sa=
y }
]
I see I can brake string's into parts, this may help me rite?
Ruby rocks, thanks to all.
=0A=0A=0A