Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## A PROJECT BY RAM THATHAM
- mouse = rand(100) ##random ints for days
- keyboard = rand(200)
- monitor = rand(300)
- rofl = 0 ##python flashbacks -- while loops for days
- if monitor > 170
- puts "Monitor powering up (RAM THATHAM INDUSTRIES)"
- puts "."*40
- else #python flashback if statement
- puts "Monitor error..."
- abort##my greatest achievement: how to stop a prohgram
- end
- puts "Power level nominal: powering RT-8819 Supercomputer..."
- def diagnostic(peripheral, tool) #tool is used as a place holder
- if peripheral > 56 #arbitrary number to continue
- puts "SYSTEMS ARE GO"
- else
- puts "#{tool} has failed ... system shutting down"
- abort #turns off if the system is off
- end
- end
- puts mouse , "mouse ^" #print numbers for my sake
- puts keyboard, "keyboard ^"
- diagnostic(mouse,"Mouse" ) #calling up this function
- diagnostic(keyboard,"Keyboard")
- puts "Enter your username:" #username- anything you want
- username = gets.chomp()
- puts "Please enter your authentication code:"
- puts "i Hope you Enjoy your Long stay in this comPuter Master tErminal"
- password = gets.chomp() ##READ THE CAPITALIZED LETTERS
- if password == "HELP ME" #looks like you read it
- puts "PLAY THIS COMPUTER IF YOU WANT TO HELP ME"
- else
- puts "Your password is unknown for this military terminal"
- puts "Eh, IDC just go ahead with this." #ram gives up
- end
- puts "Welcome to the real deal #{username} , I hope you'll use the complete suite of tools at your disposal."
- #welcome to the program !
- require "./soitbegins.rb" ##BOOTUP SEQUENCE
- rofl = 0 #refrence to my python stores!, used in the while loop
- while rofl == 0
- puts """
- 1.Comprehensive Ruby in Twenty Minutes (help).exe
- 2.Calculator.exe
- 3.Shutdown
- 4. Copy and paste machine
- """
- userinput = gets.chomp()
- if userinput == "1"
- require "./help.rb" ##calls up this file
- end
- if userinput == "2"
- require "./calc.rb"
- end
- if userinput == "3"
- puts "System log off and shut down"
- rofl = 1 #shift integer to end the program
- abort
- end
- if userinput == "4"
- puts "The copy machine: simply put in ruby and two file names into the terminal to copy and paste one to the other"
- puts "For your convenience ramble.txt and poetry.txt have been created as a benchmark"
- end
- end
- print "Thanks for your question young one: heres the answer"
- puts """
- Welcome to Uncle's ram Ruby in 20 minutes:
- https://www.ruby-lang.org/en/documentation/quickstart/
- """
- puts """
- Chose a operation:
- 1.Addition
- 2. Subtraction
- 3. Multiplication
- 4. Division
- """
- command = gets.chomp()
- if command == "1"
- puts "Add numbers:"
- alpha = gets.chomp ##RAW INPUT
- alpha = alpha.to_i ##CONVERT INPUT INTO INTEGERS
- beta = gets.chomp
- beta = beta.to_i
- print "#{alpha} + #{beta} = " #variables put in
- puts alpha + beta
- end
- if command == "2"
- puts "choose a first and second number"
- alpha = gets.chomp ##RAW INPUT
- alpha = alpha.to_i ##CONVERT INPUT INTO INTEGERS
- beta = gets.chomp
- beta = beta.to_i
- print "#{alpha} - #{beta} = "
- puts alpha - beta
- end
- if command == "3"
- puts "choose a first and second number"
- alpha = gets.chomp
- alpha = alpha.to_i
- beta = gets.chomp
- beta = beta.to_i
- print "#{alpha} x #{beta} = "
- puts alpha * beta
- end
- if command == "4"
- puts "choose a first and second number"
- alpha = gets.chomp
- alpha = alpha.to_i
- beta = gets.chomp
- beta = beta.to_i
- print "#{alpha} / #{beta} = "
- puts alpha / beta
- end
- ##COPY PASTE MACHINE USING ARGV INPUTS AND FILE READERS
- from_file, to_file = ARGV
- puts "Copying from #{from_file} to #{to_file}"
- # we could do these two on one line, how?
- in_file = open(from_file)
- indata = in_file.read
- puts "The input file is #{indata.length} bytes long"
- puts "Does the output file exist? #{File.exist?(to_file)}"
- puts "Ready, hit RETURN to continue, CTRL-C to abort."
- $stdin.gets
- out_file = open(to_file, 'w')
- out_file.write(indata)
- puts "Alright, all done."
- out_file.close
- in_file.close
- Maybe everbody in the whole damn world is scared of each other. - Mice and Men
- Life is to be lived, not controlled; and humanity is won by continuing to play in face of certain defeat. - Invisible Man
- Terror made me cruel - Wuthering Heights
- It was a bright cold day in April, and the clocks were striking thirteen. - 1984
- It sounds plausible enough tonight, but wait until tomorrow. Wait for the common sense of the morning.- The Time Machine
- It's much better to do good in a way that no one knows anything about it. - Anna Karina
- Life appears to me too short to be spent in nursing animosity or registering wrongs. - Jane Eyre
- You forget what you want to remember, and you remember what you want to forget. - The Road
- History, Stephen said, is a nightmare from which I am trying to awake. - Ulysses
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
- MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE MY NAME IS OF NO CONSQUENCE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement