# Eternity Async Tutoring

**URL:** <https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932>\
**Category:** Tutoring\
**Created:** [April 17, 2024, 11:22pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932 "2024-04-17T23:22:52Z")\
**Posts on this page:** 20\
**Page:** 43

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 4, 2025, 8:15pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/842 "2025-03-04T20:15:37Z")

</div>

> [@Elliot](#):
>
> Suppose you want to know whether the first card in the hand pairs with any other card in the hand? How could you figure that out using a loop or some other method where the number of lines of code doesn’t go up as the hand gets larger?

I did this with a different array:

```auto
a = ["B","A","C","B","A"]

a.each do |n|
  if a[0] == n
    puts "Match"
  end
end

```

It should work with the card stuff. Issue I’m having is having the first card compare to itself. Is there a way to adjust when n would start from? Or should I do it a different way?

Oh yeah: I’ve been doing it this way for a while now. By this way I mean trying out simpler code elsewhere and then trying to fit into my cards project. Is that fine?

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 4, 2025, 8:33pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/843 "2025-03-04T20:33:59Z")

</div>

> [@Eternity](#):
>
> Oh yeah: I’ve been doing it this way for a while now. By this way I mean trying out simpler code elsewhere and then trying to fit into my cards project. Is that fine?

that’s good

> [@Eternity](#):
>
> It should work with the card stuff. Issue I’m having is having the first card compare to itself. Is there a way to adjust when n would start from? Or should I do it a different way?

You could:

use an `upto` loop or something else where you control the counter

`slice` the array to exclude the first one, then use `each`

use `each_with_index` and use `next` when the index is 0

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 5, 2025, 3:40am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/844 "2025-03-05T03:40:40Z")

</div>

Some stuff to share from some events I had today:

I’ve tried a few things to help my energy: having a consistent sleep schedule (I’ve done this successfully for some time periods, no long-term consistency), eating healthier, exercising, quitting caffeine, increasing my nutritional intake, quitting vaping, and trying out various supplements. While I think certain things have had some success I wonder how much of my health has been affected by mold.

We recently got our roof repaired and thought that those leaks, due to the damaged roof, were the cause of water damage in the house. Some were. Others were not. We’ve had a pipe leaking and doing crazy amounts of water damage. Apparently the plumbers said all the houses in my neighborhood were built with it. Its so bad that you are no longer allowed to build with the stuff since ~1980 smth.

Anywaeys just seeing how much mold we actually have was insane. My moms whole walk-in closet was covered in black mold. We had black mold go into our bathroom but my mom painted it. I don’t know why I never made the connection about how the mold affected me until I saw just the sheer volume of mold we have. I’ve changed moldy shower curtains before in the past and noticed myself feeling much better. I think because I’m so used to the mold surrounding my bathroom (and probably cause it feels so far) that I never thought it could affect me.

Luckily, after dealing with some lying by our insurance company and threatening to go to a lawyer and some other stuff they agreed to cover all the damage. Should be more-or-less mold free within a few weeks or so. I wonder if I’ll notice a difference?

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 17, 2025, 2:08am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/845 "2025-03-17T02:08:42Z")

</div>

For the Duolingo assignment you mentioned in [Elliot's Microblogging - #253 by Elliot](https://discuss.criticalfallibilism.com/t/elliots-microblogging/191/253) I went ahead and chose Japanese because I have been studying it for a while already. Just a few questions:

Would my prior knowledge be a problem for this kind of thing?

Roughly how I study Japanese daily so far is to:

- Do writing lessons and reviews. Roughly write about 20 characters a day.
- Grammar flashcards
- Vocabulary flashcards (regular recall ones and type in the answers)
- an episode of anime in Japanese

I bring those up because I wonder if those count as practice. I don’t mind adding 15 minutes of DuoLingo on top of that. From what I read the assignment wasn’t given as a requirement just a recommendation but I don’t mind doing it. Will I get benefits from doing it? I feel like the stuff duo had me do so far is similar to my reviews and stuff. Should I do a different language?

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 17, 2025, 2:36am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/846 "2025-03-17T02:36:51Z")

</div>

I think trying Duo is a good idea for you, but if it ends up too similar you could stop earlier than a month. Try another language for a couple days so you can compare to Duo Japanese.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 18, 2025, 3:30am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/847 "2025-03-18T03:30:42Z")

</div>

Watched two more giraffe academy video’s:

- [Methods | Ruby | Tutorial 15 - YouTube](https://www.youtube.com/watch?v=e1EpXUgSfN8&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=15?isPin=false)
  - A block of code that performs a specific task for us.
  - Use def tp define a method.
  - The code in a method is only executed when the method is called.
  - In the case of ruby: functions and methods are interchangeable.
  - The stuff in the parentheses in a method after the name is the parameters of the method.
  - Hmm. Parameter?
    - Google:
      - ![i690x222, 100%](https://discuss.criticalfallibilism.com/uploads/default/original/2X/d/d3b7ed36083a19d94980a59fc9062a1cd6b2f2d9.jpeg)
      - Hmm. Well the parameter in this case seems to be an input into the function. idk.

    - You can give parameters default values.

  - [Return Statement | Ruby | Tutorial 16 - YouTube](https://www.youtube.com/watch?v=eG14yPuy0vk&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=16?isPin=false)
    - Last lesson we looked at how _we_ can give methods information through parameters. In this tutorial we will be looking at how methods can give _us_ information back.
    - You can put “return” in your method to define what you want to have returned when calling on a function.
    - Even though the code isn’t “done” by putting return earlier on in the method ruby does not run the remaining code in a function after the return.
    - You can return multiple values.

Have twenty or so videos left. After I finish them I plan to go through the [Ruby | The Odin Project](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby) you mentioned before.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 18, 2025, 3:58am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/848 "2025-03-18T03:58:50Z")

</div>

> [@Eternity](#):
>
> Well the parameter in this case seems to be an input into the function. idk.

yes parameters means inputs

> [@Eternity](#):
>
> You can return multiple values.

not exactly. you can return an array that holds multiple values, but the array is itself a single value that’s returned. also ruby has some syntax shortcuts that can make it look more like returning multiple values.

 ![image](https://discuss.criticalfallibilism.com/uploads/default/original/2X/6/696aac695f5614cbdca5eb9e51a3fabb2d8ab0d6.png)

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 20, 2025, 3:15am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/849 "2025-03-20T03:15:40Z")

</div>

> [@Elliot](#):
>
> yes parameters means inputs

Hmm. So I just realized: do the parameters determine where the inputs go? By that I mean in:

```auto
def rank_to_number(rank)
  # J = 11, Q = 12, K = 13, A = 14. For now we'll ignore how A can sometimes be 1.
  rtn = {"A" => 14, "J"=> 11, "Q"=>12, "K"=>13,"T"=>10, "2"=>2, "3"=>3, "4"=>4, "5"=>5 , "6"=>6, "7"=>7, "8"=>8, "9"=>9}
  print rtn[rank]
end

```

I kept thinking that the "rank) in the parentheses referred to an array or something. To put it differently I thought what that string of words is mattered. I though “rank” had a coding reason to be named rank. The code could work just as well with “rank” being renamed as “lemon”. Right?

Also if I move around “rank” in the code it will put in that input at that spot. I guess thats obvious but I was bit confused thinking that if I don’t put in a rank array or something in the rank spot it shouldn’t run.

* * *

I watched three giraffe academy videos. The last one was a simple calculator he put together with puts, gets, and if statements. Nothing covered to note. Here’s my notes from the other two:

- [If Statements | Ruby | Tutorial 17 - YouTube](https://www.youtube.com/watch?v=Ss-IHmrSTow&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=17?isPin=false)
  - For an if statement that is dealing with boolean values (true or false) by default an if statement will look to see if the value/variable with a value is true. You can set it up to run while false but by default it has to run when true.
  - You can check for two boolean values (and maybe more?) by simply using the word “and”. Something along the lines “if true and true”
  - “or” if one of the values is true
  - ! = not
  - I assume this follows the truth table stuff I did before.

- [If Statements (con’t) | Ruby | Tutorial 18 - YouTube](https://www.youtube.com/watch?v=VhI3a1yGNrU&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=18?isPin=false)
  - if statements need conditions
  - you can use comparisons in ruby to get a true or false value
  - when comparisons are resolved the return value(?) is true or false

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 20, 2025, 3:16am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/850 "2025-03-20T03:16:19Z")

</div>

> [@Elliot](#):
>
> not exactly. you can return an array that holds multiple values, but the array is itself a single value that’s returned. also ruby has some syntax shortcuts that can make it look more like returning multiple values.

Ok. The video did mention that but I don’t know why I didn’t take it seriously when he said it returns an array.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 20, 2025, 3:55pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/851 "2025-03-20T15:55:07Z")

</div>

> [@Eternity](#):
>
> I kept thinking that the "rank) in the parentheses referred to an array or something. To put it differently I thought what that string of words is mattered. I though “rank” had a coding reason to be named rank. The code could work just as well with “rank” being renamed as “lemon”. Right?

Yes “lemon” would work. You’re just giving names to the input(s), similar to giving a name to the function.

> [@Eternity](#):
>
> You can check for two boolean values (and maybe more?) by simply using the word “and”.

you can check more values using more than one `and`.

> [@Eternity](#):
>
> I assume this follows the truth table stuff I did before.

yes

> [@Eternity](#):
>
> when comparisons are resolved the return value(?) is true or false

yes. for example:

`3 > 2 # returns/outputs true` (the # creates a comment for the rest of the line. comments are for people to read. the computer ignores them)

the `>` is just a function available to the Integer class. you can do `3.>(2)` so it looks like other function calls

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 22, 2025, 12:12am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/852 "2025-03-22T00:12:25Z")

</div>

Came across this quote while doing reviews, from [Why Does He Do That?](https://www.amazon.com/Why-Does-He-That-Controlling/dp/0425191656#:~:text=Book%20details&text=In%20this%20groundbreaking%20bestseller%2C%20Lundy,free%20of%20an%20abusive%20relationship.):

> The good news is that remorse is often genuine; the bad news is that it rarely helps.

Something I relate to. I often feel genuine remorse for some things I’ve done and I’ve mentioned before how I think that remorse is a substitute for dealing with the stuff I did.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 22, 2025, 12:33am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/853 "2025-03-22T00:33:48Z")

</div>

Watched two giraffe academy video’s:

- [Case Expressions | Ruby | Tutorial 20 - YouTube](https://www.youtube.com/watch?v=eBtz-QBbWV0&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=20?isPin=false)
  - case expression is a special type of if statement
  - case expressions simplifies comparing the _same_ value to a bunch of _different_ values

- [While Loops | Ruby | Tutorial 21 - YouTube](https://www.youtube.com/watch?v=3bXd6h8Zsfk&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=21?isPin=false)
  - While loops are for looping through a block of code a specific number of times
  - while loops need a condition
    - so long as the condition is true, while loops will keep running the code

  - if you have var = var + 1, you can do var += 1 instead.
  - infinite loops are, in general, very bad. apparently their are high level use cases for them though. neat.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 22, 2025, 1:55am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/854 "2025-03-22T01:55:50Z")

</div>

> [@Eternity](#):
>
> While loops are for looping through a block of code a specific number of times

That’s `for` loops.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 22, 2025, 1:56am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/855 "2025-03-22T01:56:47Z")

</div>

> [@Eternity](#):
>
> infinite loops are, in general, very bad. apparently their are high level use cases for them though. neat.

You can get out of loops with `break` or `return`. Or a video game could have a main loop that just runs forever until you quit the game.

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 25, 2025, 7:15pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/856 "2025-03-25T19:15:34Z")

</div>

What’s happening to US lawyers FYI

[![](https://discuss.criticalfallibilism.com/uploads/default/original/2X/b/b06edfb93cd57755cefe14e46af4d7a04d2960d5.jpeg "#fyp #law") ](https://www.tiktok.com/@cohen489/video/7484117821430222126)

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 25, 2025, 8:40pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/857 "2025-03-25T20:40:17Z")

</div>

Hmm. That sucks. I’m kinda surprised to hear that corporate law firms are being affected. I wonder how far this stuff will spill.

I wonder if part of the reason for inaction is because, regardless of how bad things maybe are (I don’t know I haven’t been keeping up), companies are just used to pressure from the government.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 26, 2025, 1:04am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/858 "2025-03-26T01:04:41Z")

</div>

Watched giraffe academy’s videos 22-24. Only took notes on video 23:

- [For Loops | Ruby | Tutorial 23 - YouTube](https://www.youtube.com/watch?v=LqUT1K_Q7-M&list=PLLAZ4kZ9dFpO90iMas70Tt4_wYjhLGkya&index=24?isPin=false)
  - A for loop allows us to loop through a specific collection like an array.
  - for x in y
    - x refers to the variable, the variable name is for your user understanding, not for making the code run
      - However it is what defines the variable that your code interact with. If you did:
        - for number in array
        - puts number

      - every time the for loop is going through the code the variable part takes on a different value

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 26, 2025, 1:06am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/859 "2025-03-26T01:06:24Z")

</div>

So for getting pairs I came up with this with if statements:

```auto
a = ["D","A","C","C","A"]

1.upto(4) do |n|
  if
  a[0] = a[n]
    puts "Match"
  elsif
  a[1] = a[n+1]
    puts "Match"
  elsif
  a[2] = a[n+2]
    puts "Match"
  elsif
  a[3] = a[n+3]
  puts "Match"
  elsif
  a[4] = a[n+4]
    puts "Match"
  end

end

```

I do realize that this wouldn’t be efficient to scale up. Also, I’m having trouble with numbers getting used twice. Any advice?

---

<div class="post-metadata">

**Author:** ![Elliot](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/elliot/32/14_2.png) [@Elliot](https://discuss.criticalfallibilism.com/u/Elliot)\
**Post date:** [March 26, 2025, 3:18pm UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/860 "2025-03-26T15:18:45Z")

</div>

> [@Eternity](#):
>
> Any advice?

> [@Elliot](#):
>
> So let’s break the problem down into smaller parts.
> 
> Suppose you want to know whether the first card in the hand pairs with any other card in the hand? How could you figure that out using a loop or some other method where the number of lines of code doesn’t go up as the hand gets larger?

Also I think you may be losing track of some other information you already have.

[Eternity Async Tutoring - #794 by Elliot](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/794)

> ```auto
> def find_pair(hand)
> # return rank (as 1-character string) of highest ranked pair in hand
> 
> ```

You’re just printing match not saying what rank the pair is.

Anyway, I think breaking it down into simpler parts is the key. When stuff is hard, confusing, too complicated, etc., looking for ways to deal with sub-parts is generally the most important thing to try.

---

<div class="post-metadata">

**Author:** ![Eternity](https://discuss.criticalfallibilism.com/user_avatar/discuss.criticalfallibilism.com/eternity/32/5930_2.png) [@Eternity](https://discuss.criticalfallibilism.com/u/Eternity)\
**Post date:** [March 27, 2025, 2:44am UTC](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932/861 "2025-03-27T02:44:44Z")

</div>

> [@Elliot](#):
>
> Anyway, I think breaking it down into simpler parts is the key. When stuff is hard, confusing, too complicated, etc., looking for ways to deal with sub-parts is generally the most important thing to try.

This seems to come up quote often and I don’t disagree with it. Do you have any assignments (besides obviously what we are working on right now) that I could to practice breaking something up into simpler parts?

> [@Elliot](#):
>
> Also I think you may be losing track of some other information you already have.

Yes, Thats also why I started my project of posting consistently. I noticed I forget a lot of details due to some of the long breaks I take. My goal is to try and even work a little bit daily so I don’t forget stuff so often. I could, alternatively, also work on maybe noting some of the stuff better? So I have access to it more often?

[Previous page](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932.md?page=42)

[Next page](https://discuss.criticalfallibilism.com/t/eternity-async-tutoring/1932.md?page=44)
