Last active
April 13, 2022 06:06
-
-
Save caioertai/c760e0ac53343a633136294daad7bcc2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RECAP | |
# On representation: | |
# 1. The name of a dog. | |
# 2. The age of a person. | |
# 3. The height of a person in meters. | |
# 4. Affirmation of negation. | |
# 5. ??? | |
# On retrieving and assigning values: | |
# ??? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Programmer's Spouse: | |
# - Go to the store and get a loaf of bread. If they have eggs, get a dozen. | |
# Programmer returns with 13 loaves of bread. | |
# Live-code: Interactive voting age program | |
# Using inline conditionals | |
# Examples of truthy vs falsy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Live-code: Let's flip coins | |
# Can we make it shorter? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Live-code: Morning? Afternoon? Evening? Lunch time! | |
hour = gets.chomp.to_i | |
# Say to which fraction of the day the hour belongs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Live-code: Old School UI | |
# User should be able to choose either: | |
# - read | |
# - write | |
# - exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Live-code: Opening hours | |
# Print the state of a shop that opens at 8, closes at 19, but is closed at noon | |
hour = gets.chomp.to_i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Live-code: Find the right random number | |
number_to_find = rand(1..5) | |
# Give user the option to guess the number | |
# Print the result of the guess. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Declare an array of the Dungeons and Dragons Cartoon characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
characters = ["Bob", "Sheila", "Uni"] | |
p characters | |
# Print all characters names: | |
# Using for | |
# Using while |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment