From 1961acc0b926fcd8da291017b5ac3b3908eef861 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 8 Jul 2022 12:04:02 +0100 Subject: [PATCH 1/3] amended the route --- app.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.rb b/app.rb index 4abb71ec..e89f9a08 100644 --- a/app.rb +++ b/app.rb @@ -1,7 +1,7 @@ require 'sinatra/base' class RockPaperScissors < Sinatra::Base - get '/test' do - 'test page' + get '/main' do + 'home page' end run! if app_file == $0 From c055789e05bcc21f63e8c3a901ea4bdd4373af96 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 8 Jul 2022 15:24:58 +0100 Subject: [PATCH 2/3] updates --- app.rb | 9 +++++++-- spec/app_spec.rb | 5 +++++ views/index.erb | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 spec/app_spec.rb create mode 100644 views/index.erb diff --git a/app.rb b/app.rb index e89f9a08..3143f54b 100644 --- a/app.rb +++ b/app.rb @@ -1,8 +1,13 @@ require 'sinatra/base' class RockPaperScissors < Sinatra::Base - get '/main' do - 'home page' + get '/' do + # p params + # @random_name = params[:name] + erb(:index) end run! if app_file == $0 end + + + diff --git a/spec/app_spec.rb b/spec/app_spec.rb new file mode 100644 index 00000000..5b7a0cf9 --- /dev/null +++ b/spec/app_spec.rb @@ -0,0 +1,5 @@ +require "app" + +RSpec.describe "rock, paper, scissors" do + it "has a route to a start page" do + expect(page).to \ \ No newline at end of file diff --git a/views/index.erb b/views/index.erb new file mode 100644 index 00000000..a71a8cd5 --- /dev/null +++ b/views/index.erb @@ -0,0 +1,8 @@ +# <% if @random_name %> + +# <%end%> +

My name is Ro

+#
+#
+ # + #
\ No newline at end of file From 0358659ac8341e22300f2fd91f93306847dc2ee9 Mon Sep 17 00:00:00 2001 From: Joe Date: Sat, 9 Jul 2022 14:24:08 +0100 Subject: [PATCH 3/3] weapn buttons --- app.rb | 13 ++++++++++++ public/download.jpeg | Bin 0 -> 8102 bytes views/index.erb | 47 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 public/download.jpeg diff --git a/app.rb b/app.rb index 3143f54b..7c7b7870 100644 --- a/app.rb +++ b/app.rb @@ -6,6 +6,19 @@ class RockPaperScissors < Sinatra::Base erb(:index) end + get '/' do + erb(:index) + end + + post '/' do + p params + @player_name = params[:name] + p @player_name + @player_move = params[:move] + p @player_move + erb(:index) + end + run! if app_file == $0 end diff --git a/public/download.jpeg b/public/download.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..d180db412350aa7817f5c24c167fc048094408ea GIT binary patch literal 8102 zcma)gbx;&u)by%=H4&eZvrSaR1vBG92@`u=br)YR{=->2_X?J zEe$;_EiD5BJp&6XEAxL~W&7taGBPqVGctoY1i0B)`8XJvc_bh4KNb=b6JrKHQFtOM zFCZ!=ghNV7N=ZS<3Ief-^MUz9{|Dm#cl-ZZ@4Eq1M1Xdjhj=)g09+~@JSv>~egG2y zfQyIoU#b5KTs!~{K9GR$ABms@;Narn6A%#L;}HOX|LMV{0^o7rgM<`;`gXpN=?^(e znx;<)sD+gb?0dfYMWIU#XU=Fulrx%p3Aw;V&qW=g%YM@S3q|)Y$N!tLzC+MGb> zZ16W#uIPdKhnj4rd7E916Ou94fx$g(FJ%q~lvFmuPbap*lEmR2Qp*NAkb^A2w`PJH zNiX!GKqoGf-Ch1Y@z2%05@w#>1MFRxhC6@<8NQb<5%++vZw%`$Ll<&XLsR2I^py;> zArW`Vz~(cb$PHR2UD!Q9+od9mbo9r;*S+8eurexVtS66E_ifj-ZmVyis$pGQl;NLc z$<4xRzk1DXZZ$o-eg_hjTFvn1GUC-Dd>?9K^Y_(TELfYLH4Xh$+HdrK8F&<3CeFWN zis~i*wJEMNfl+DH4qzP?aVknxb|DX$;INAwn?K*c&)w+3l4*0lpc$$)aNT3F8wHM= zhu8+pT7gTRQZZKj##vlu%n)$zNO$%At$B>mU5#MS45W2E5-Tw~lyqN?<+44i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2{1uRGm8NUc`bk6V< zo)6v3-*6da!yHA_Sd~Md-_s~Hr>Y}hO|vPbT=MsTd0pO)FjH;DpQ{(^?^hYhWTV_D z%+Qw`WCvu^EKC}+yfiMoH{#ddOJ^dW4}Kyylsmev_UMl;hU-C0l#pDP$qxW+wl-;N z&VZw3l6Gdz&e?^<%;FFSk;21UtIO8M}H%eD( zaQr0$3$V|2qI%b@ujOYdNnFfm!r-$V`jLjcTU*oisb!4UQV1zjeXeTWIh(P(0I7_# zxU|+9Gm0n17Y#=&kwB{3a6}TfwNIUgsab!%`{fqJC~57}e47t%vaisxp4DHb-&=Ra zr)oa(FiAF)GH+1ms3b@loJ?~Ma{oE?B8LVNf^XdS3f`Ix`fi7SAZq0_bF`a@|J1f~$&FG!U0ir38< zWZv@?H&K%DdN5wxsOsR!I16*JRcBs)X%hC}yp6e*cIC(4MvWGB(>k4N6Oju!8-d63 zYFYH@X!TAtqye>$pX8r1tyYi~sl+wBNxY(haa z3Ng4kzv}}J*ojtZ>XFl;t|kJ2 z5MPsA#P#yMQmh+Az+%!7$81j}2WkNwE;KCIN?wfMFG7)>uMyU)hbL#0#Q0l&!%k}i zb&%(HfS&7K>Smw$#J(P5BJi*S{+kH`vz zIN^xW^B9V*qOO)0&SzsbRKDy`ZHzz&ru(gvP!w$}J?kW?Up$DLOldyPg<$AM%(}-L z8&L#iRPtSMxn@T+8oH15PpsRJr z*5e8LM4cduTf*GWL9lvugawM>Q6F0#;~VvUu$Um}s+uKB6DQmtWYsAKClb#ad!yuR zvB6B!P1;{pPb|I!ByKK^;iu_ms0wE%?f`ohY3XYH>w-ey&({ VTAOpWN(Ta1pZ(|k(}B2O{y&sSu66(b literal 0 HcmV?d00001 diff --git a/views/index.erb b/views/index.erb index a71a8cd5..6888edd1 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,8 +1,39 @@ -# <% if @random_name %> - -# <%end%> -

My name is Ro

-#
-#
- # - #
\ No newline at end of file +<% if @player_name.nil? %> +

Please enter your name

+
+ + +
+ +<% elsif @player_name %> + +

Greetings and salutations <%= @player_name %>

+ +

Choose your weapon!

+
+ + +
+ +
+ + +
+ +
+ + +
+ +<% elsif @player_move = "rock" %> +

You chose

+ +<% end %> + + + + + + + +