Instantly share code, notes, and snippets.

View gist:01bd18185cfd459f563fbcfb85ac4493
<a href="https://adriculous.life/new-linkup-at-home/"><img src="https://i.imgur.com/D2npKNb.png" alt="At Home - a Linkup Hosted by The ADRICULOUS Life" /></a>
View keybase.md

Keybase proof

I hereby claim:

  • I am adriculous on github.
  • I am adriculous (https://keybase.io/adriculous) on keybase.
  • I have a public key ASBPDxqfUqeNBwFIzQAbI7-iZ_Y1HWhO42TPj3F2Mkm0pQo

To claim this, I am signing this object:

View hashes.rb
# Symbols and Hashes
manga_01 = { title: "Cardcaptor Sakura",mangaka: "CLAMP" }
manga_02 = { title: "Zodiac P.I.",mangaka: "Natsumi Ando" }
manga_03 = { title: "The Kindaichi Case Files",mangaka: "Yozaburo Kanari (writer) & Fumiya Sato (illustrator)" }
manga_04 = { title: "Mermaid Melody Pichi Pichi Pitch",mangaka: "Michiko Yokote (writer) & Pink Hanamori (illustrator)"}
puts "My favorite manga series is " + manga_01[:title] + " by " + manga_01[:mangaka] + "."
View manga2.rb
# Doing some OOP (object oriented programming) where we can create our own objects and define them. I'll be using manga information as my example.
class Manga
attr_accessor :title, :mangaka, :genre
def about_manga
return "A good #{@genre} manga that I recommend for everyone to read is #{@mangaka}'s #{@title}."
end
end
View manga.rb
# Doing some OOP (object oriented programming) where we can create our own objects and define them. I'll be using manga information as my example.
class Manga
def set_title=(title)
@title = title
end
def get_title
return @title
end
View blog.rb
# This is an actual blog script, built by Ruby. Gotta use class variables, class methods, loops, make your own methods, make your own objects, etc. etc. etc. This ain't no WordPress, by the way.
class Blog
@@all_posts = []
@@num_posts = 0
def self.all
@@all_posts
end
View always_three.rb
# You are now at the Always 3 script. It's in Ruby, girl. Hello and welcome!
# Ask the person (user) to provide a number. Any number.
puts "Please, give me your number, I mean A number!"
# Hint: use 'gets' method, convert to an integer using 'to_i', make it a variable
i_number = gets.to_i
# Hmm... PEMDAS? ("Please Excuse My Dear Aunt Sally")
puts "You know what it is! " + (((i_number + 5) * 2 - 4) / 2 - i_number).to_s + " of course!"
View always_three.rb
# You are now at the Always 3 script. It's in Ruby, girl. Hello and welcome!
# Ask the person (user) to provide a number. Any number.
puts "Please, give me your number, I mean A number!"
# Hint: use 'gets' method, convert to an integer using 'to_i', make it a variable
i_number = gets.to_i
# (Refactoring script) Need to refactor using only two variables. I took out the ii_number variable from the old version and left with i_number and fin_number. Maybe...
fin_number = i_number
View numerology.rb
# Numerology app. I'm new to this, since I'm completely unfamiliar with Numerology in itself. Okay, here we go! Ganbarimasu!
# the person/user inputs his/her birthday in integer format
puts "Welcome to the Numerology App! Let's start off by giving me your birthdate. Please provide it in MMDDYYYY format. Thank you!"
# using gets to get their birthday to a variable
birthday = gets
# going to use .to_i to convert the inputs to integers in array format
number = birthday[0].to_i + birthday[1].to_i + birthday[2].to_i + birthday[3].to_i + birthday[4].to_i + birthday[5].to_i + birthday[6].to_i + birthday[7].to_i
View always_three.rb
# You are now at the Always 3 script. It's in Ruby, girl. Hello and welcome!
# Ask the person (user) to provide a number. Any number.
puts "Please, give me your number, I mean A number!"
# Hint: use 'gets' method, convert to an integer using 'to_i', make it a variable
i_number = gets.to_i
# add 5
ii_number = i_number + 5