This file contains 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
#Single line comment | |
=begin | |
Multiple line | |
Comments | |
=end | |
def say_hello(name) | |
#with out new line | |
print "Hello, " | |
# with new line |
This file contains 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
// THIS CLASS CREATES A CARD OF A GIVEN RANK AND SUIT | |
package classes; | |
public class Card { | |
// class methods | |
private final int suit; | |
private final int rank; | |
// suit initializations | |
public final static int DIAMONDS = 1; | |
public final static int CLUBS = 2; |
This file contains 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
import java.util.ArrayList; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); | |
ArrayList<Student> students = new ArrayList<Student>(); | |
while (true) { |
This file contains 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
import java.util.Random; | |
import java.util.ArrayList; | |
public class KeyCreator { | |
// Define the variables | |
private Random random = new Random(); | |
private int passwordLength; |
This file contains 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
import java.util.ArrayList; | |
import java.util.Random; | |
public class LotteryNumbers { | |
private ArrayList<Integer> numbers; | |
private Random random = new Random(); | |
public LotteryNumbers() { |
This file contains 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
module Welcome | |
puts "Welcome to the Ultimate Harmonizer Adventure: Backstage Edition!" | |
puts "Press [ENTER] to begin!" | |
$stdin.gets.chomp | |
puts "\nREMEMBER: Press [ENTER] when you see '...' and type in your answer when you see '>'." | |
puts "Have fun!!!" | |
puts "..." |
This file contains 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
def answers(one, two, three, four, five) | |
puts "I once #{one} a snake. It was lots of fun." | |
puts "It's hard to go water skiing when you don't have #{two}!" | |
puts "The longest time she's gone without showering is #{three} days..." | |
puts "Ever since I was young, I've always wanted a pet #{four}." | |
puts "Learning Ruby is #{five}!" | |
end | |
puts "Welcome to MadLibs: Ruby Edition!" | |
puts "Press RETURN to begin and CTRL-C (^C) to quit!" |
This file contains 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
puts "\n" | |
puts "\n" | |
puts "\n" | |
puts "Welcome to the Ultimate Harmonizer Adventure! Will you be able to find Fifth Harmony?" | |
puts "\n" | |
puts "REMEMBER: All of your answers must be numbers!" | |
puts "Press [ENTER] to begin!" | |
$stdin.gets.chomp |