From 87369f57b42c59fdabdeb9ea53d9ed0da0ddf622 Mon Sep 17 00:00:00 2001 From: Chris Hutchinson Date: Tue, 17 Jan 2017 15:54:19 -0500 Subject: [PATCH] Completed the challenge --- Chris-Game/controller.rb | 42 +++++++++++++++++++ Chris-Game/model.rb | 21 ++++++++++ Chris-Game/view.rb | 76 +++++++++++++++++++++++++++++++++++ Jays-Game/.controller.rb.swp | Bin 0 -> 12288 bytes Jays-Game/.model.rb.swp | Bin 0 -> 12288 bytes Jays-Game/.view.rb.swp | Bin 0 -> 12288 bytes 6 files changed, 139 insertions(+) create mode 100644 Chris-Game/controller.rb create mode 100644 Chris-Game/model.rb create mode 100644 Chris-Game/view.rb create mode 100644 Jays-Game/.controller.rb.swp create mode 100644 Jays-Game/.model.rb.swp create mode 100644 Jays-Game/.view.rb.swp diff --git a/Chris-Game/controller.rb b/Chris-Game/controller.rb new file mode 100644 index 0000000..18c0700 --- /dev/null +++ b/Chris-Game/controller.rb @@ -0,0 +1,42 @@ +require_relative 'model' +require_relative 'view' + +class DeafGrandmaController + include DeafGrandmaView + + def run + Print::title + + loop do + Print::main_menu + case Print::get_user_input + when"N" + play_game + when"T" + Print::tutorial + when "E" + Print::bye + exit + else + Print::error + end + end + end + + def play_game + Print::game 'HOWDY SONNY!' + loop do + input = Print::get_user_input + if (input == 'BYE!') then + return + elsif (input != input.upcase) then + Print::game 'SPEAK UP SONNY!' + else + # Print a random message from the model. + Print::game DeafGrandmaModel::SENTENCES.sample.upcase + end + end + end +end + +DeafGrandmaController.new.run diff --git a/Chris-Game/model.rb b/Chris-Game/model.rb new file mode 100644 index 0000000..0bbc627 --- /dev/null +++ b/Chris-Game/model.rb @@ -0,0 +1,21 @@ +class DeafGrandmaModel + SENTENCES = ["If the Easter Bunny and the Tooth Fairy had babies would they take your teeth and leave chocolate for you?", + "A purple pig and a green donkey flew a kite in the middle of the night and ended up sunburnt.", + "Last Friday in three week’s time I saw a spotted striped blue worm shake hands with a legless lizard.", + "Wednesday is hump day, but has anyone asked the camel if he’s happy about it?", + "If Purple People Eaters are real… where do they find purple people to eat?", + "A song can make or ruin a person’s day if they let it get to them.", + "Writing a list of random sentences is harder than I initially thought it would be.", + "Where do random thoughts come from?", + "Lets all be unique together until we realise we are all the same.", + "I will never be this young again. Ever. Oh damn… I just got older.", + "If I don’t like something, I’ll stay away from it.", + "I love eating toasted cheese and tuna sandwiches.", + "If you like tuna and tomato sauce- try combining the two. It’s really not as bad as it sounds.", + "When I was little I had a car door slammed shut on my hand. I still remember it quite vividly.", + "The clock within this blog and the clock on my laptop are hour different from each other.", + "I want to buy a onesie… but know it won’t suit me.", + "I currently have 4 windows open up… and I don’t know why.", + "I often see the time 11:11 or 12:34 on clocks.", + "This is the last random sentence I will be writing and I am going to stop mid-sent"].freeze +end diff --git a/Chris-Game/view.rb b/Chris-Game/view.rb new file mode 100644 index 0000000..b178188 --- /dev/null +++ b/Chris-Game/view.rb @@ -0,0 +1,76 @@ +module DeafGrandmaView + + module Print + + class << self + def title + content = <{BoGBuMiw^}q(y2HTJfPu2thy<RU^?4(uxnAF6Xz2TgN_ZUkeOH z@CR6!7+4Ve05<*rBMdCed`SEZ-pgH@2GXJGROvnGxwC!t>(|eDiQ-13ey7H-l%^S8 zrx|mz+pCX0j<BD@Lo8|~K59wrj85O~c~xt*YGrC^u5x*G_Ug)fNtq~A1A1@o3RpI} zVL~gUZkB8HYBOv@c`khFCTG)9WVE+NDX=Bm7!Zk?$N(AGzky*kJ$12?jvFhC@-rj% z_8)>qkO4A42FL&zAOmE843GgbaA*zqc!)j6?2qItIF~<%{(0tAdXND!KnBPF86X2> zfDDiUGC&5%02v?yhtNPM7`uOhvE##-JpTXR{r&&v6k}hJFUTk41M(hugS<puAnV8? zvVa^#exGFQ7xEqXjJ!i$BkRZm<N|UQ`GIqNL*62<5RWvGhsbs05;BPtkujuzr1>2~ z=pqATfDDiUGC&5%02v?yWPl7D+(3HpxY|2+tYNEU6FtfpXu&wo?!D*k66bfV)P80L ztTi@hgL7dMa8P=Ia@`_Uo=DF+&3KCw?|5MaiWayq8VWprwbcU63k!vvp56#EFP$$5 zP~ag*>*M*HS(6B)D0vgeiM|-O2E>R=JN_?9w{ed+)d6urA^H+=U}dP}vn;*-JZ|*H z=V`~Ou|VOX#&=ei7F_?pdUs$HI_PR%13Z@=BsgIpHCoJ<oJVehPC6~hm>9*fPGxKv zPqJ_Dn_;xkK-auxP#izc>k_uI4z+LtcsCc`2H!HmaV4>J@%Ga4TB6cT5F5<f@p0TA zWf0PrlURfv%Gqa_$R^7(@zN^@Tx0=sXO6rb_f_CxsWsTF|IVz}c;_=?aO^K&jb~es vbEzYh2;k{1?W7#3(78^vw`m!(@Hmkc0t+hiauay5ovyPu;Ke2`yvY6nCc7u- literal 0 HcmV?d00001 diff --git a/Jays-Game/.model.rb.swp b/Jays-Game/.model.rb.swp new file mode 100644 index 0000000000000000000000000000000000000000..bb855401071f623ac4a5768d1de5be8a43c4cdf1 GIT binary patch literal 12288 zcmeI2zi$&U6vtgweyR*Gp+_0o2)Kq;P>6`ARA>dXEc{kgA~$wYtM?0^1L_YzVnX}} zuz|#k#0UcuI|E`xAi>1I3M_nmy`)Jg3~Wg6q)#sP`8_{>><m?JzI^5E42=b&0@p4f zvZ=e*ZoKFh>5e{8Uue1df{C*v_D}zKP0Y+plt(U}D<8Wyb^Pjd5GHjQZZi6ASHj^W zo=>DzCT<STT$yOfNDrTrOWENm|1C<C4g)*CNfPd218m?Q4Qv;qBS*?U_`tw^+TDNo zAM<b+8(;%$fDNz#Hoykh02^Qf|Dyqy_KABad`nUMiQ?Y3;a)WP#s=5`8(;%$fDNz# zHoykh02^QfY=8~?hX$k)VstCmhT`%6|MuVi-*yV|348?a!Bg-AJOnK;3yy+)U@zDM zwt%lYg!lqJgLmK!cnw~Gm*6>g3?6|8zySr$gEQbX2!H@TwhQqcd<4(HBA5i@;1no< zKJXK@{{SDrTW}vN0|zo-zyi1qs$dNG^^O3(*Z><~18jf|umLu}2G{@__^SaOD?zmO zNwi{Ag~n5BB59XuM$y449iclIp>%^98gCGzSD=kCx1`hlYdg4oCz49lT%wX8XI!W& zG$|LgtyHEHtE1p{V$~t!%j(vo&Lr`M=b4V3j_bNa$W3%Ka3<0jsRT`5MVh3o5L4Gw zD~gu#d9v;@#{JA$fOn2H2AKw}&}zI&ae(DitAx+?dWs==rAC#ylhl(a_3^4^oQ`J8 za{-Jj);isJX$@&Y8n}><A48GM->+_xTaXUZ3{Wc$b(T>lD9@Eg_I6Q~ilQ?VU3b1> zU(_o3&)@5AN3S{FQ2AOWI(d>V`QTXJ9x`#-azUhRQxCQGuv98^cJ?YC)gxh3(}b&- zqe`=L`Et5XOqI$-W)mA{WN4Q2QzD(SHLIo4mMVT-nW%>ndZtb0gy=no<LxE-!|6A@ z(>~R`OY6g+(AkzQMsL_F^tR7tPeen8nGeB&x{f1KN!!e3D_woXGV|lyd7ih5C;n^| zVMfjQlk2NqH;_LgUwe-SgI_`=&x3o{d}wu6TxjyUDTLKGTgGY{OzqO(daL1oV1wcp DODTVP literal 0 HcmV?d00001 diff --git a/Jays-Game/.view.rb.swp b/Jays-Game/.view.rb.swp new file mode 100644 index 0000000000000000000000000000000000000000..a2a872240ac100da5527a0b6672f0ade4a98e378 GIT binary patch literal 12288 zcmeI2&2QX97>6eusQ74$S}wGgH;xe5sBzMS7L+!u%4QX%$|_B|q?OWW>#S#Yr}4+) z853=@Ddk^49Dy5Bj|g!pSGa(n;x7Qy3%7FNMk{_}dw0D}K&VKFN@MAXJ)ZIFcb=K? z%8Iw9*Ow~vhCR!$y~LPYymhtq#W7YqGQ#SuSk+r1kYS)}|8gr;Dy8X}%NM85UR`|i z%ChZ+b;moP^{rgMsW8|IoyZkIbE>jlYC1ljy6AM|<f1-$Pw*W(+BzVHIb{qO15aw; zFq@q@J*}@EvqtIov3H&{kh#tnFb0ePW55_N28;n?z!)$Fo<akvJ;L5c-p^#YU(WU; zkL|Of*%<@IfH7bU7z4(DF<=ZB1IB<cU<?=o#=ui(z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