Skip to content

Instantly share code, notes, and snippets.

@adriculous
Created July 21, 2016 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adriculous/b55d7f279d6d191f31a0518ffbd946eb to your computer and use it in GitHub Desktop.
Save adriculous/b55d7f279d6d191f31a0518ffbd946eb to your computer and use it in GitHub Desktop.
PEMDAS!!!
# 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!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment