たくさんのサイトを見て悩みました。
結論としては、ほぼどのサイトでも
【Progateは何周もする必要はない】が
【完全なるプログラミング初心者】には最適だ、でした。
ならば課金して受講してみましょう。
なにせ完全なるプログラミング初心者なのですから。
前回の続きはeach文の変数から。
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_2-1024x490.png)
なんかpythonでも見たような形。
.eachの後にdoとendを忘れないこと・・・。
スコープって何だ?
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_3.png)
それから、ハッシュの使い方
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_4-1-1024x114.png)
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_5.png)
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_6.png)
ここでLv13にアップ!
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_7.png)
シンボルを使って=>を省略するやり方
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_8.png)
ちょっと混乱してきた(o゚▽゚):
省略って便利だなぁ、と思っていたら出力する時に注意が必要だった。
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_9.png)
ここの演習に時間がかかりました・・・。
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_10.png)
nil (何もない)と if文
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_12-1024x473.png)
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_13-1024x471.png)
ここが自分的には一番時間がかかりました。
配列の要素にハッシュを入れられても
その後に文字列と合わせて putsする書き方が何度やっても❌
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_15-1024x146.png)
答えを見ることが多くなったのですが
自分のコードと答えのコードを見比べて考える事ができます。
間違っている場所も背景色を変えて教えてくれるので
ガチガチの初心者には、とても有り難いと思いました。
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_16-1024x295.png)
最後に総合問題を二つ終えて
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_18-1-1024x493.png)
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_19-1024x491.png)
ようやくⅡコースが修了です。
![](https://goohayami.com/wp-content/uploads/2022/02/ru2_20.png)