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
<script> | |
function validateForm() { | |
if((document.getElementById("creditScore_Excellent").checked == false) && (document.getElementById("creditScore_Good").checked == false) && (document.getElementById("creditScore_Poor").checked == false)) { | |
alert("Please enter a credit score"); | |
return false; | |
} else { | |
return true; | |
} | |
} |
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
# Load the dictionary, store it in an array, shuffle it | |
dictionary = File.open('dictionary.txt') | |
dictionary_array = dictionary.readlines | |
dictionary_array.shuffle! | |
# Intro text, wait for user to type 'start' | |
puts "\n<<< Terminal Hangman >>>\n\n" | |
puts "Type \"start\" to begin a new game\n" | |
turn = 0 | |
rematch = nil |
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
# Load the dictionary, store it in an array | |
dictionary = File.open('dictionary.txt') | |
dictionary_array = dictionary.readlines | |
puts "<<< Terminal Spell Check >>>\n\n" | |
puts "Type in a word, and see if it is a valid English word\n" | |
print "> " | |
user_word = gets.chomp.downcase.strip |
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
# Initialize Variables | |
deck = [] | |
suits = ["C", "H", "S", "D"] | |
card_nos = [2,3,4,5,6,7,8,9,10,"J","Q","K","A"] | |
user_hand = [] | |
@@dealer_hand = [] | |
user_hand_total = 0 | |
valid_input = ['hit', 'stand', 'double', 'split'] | |
# Create a Deck |
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
# Load the text file, create an array consisting of each line | |
txt_data = File.open('questions.txt') | |
txt_data_array = txt_data.readlines | |
txt_data_array << "FINISHED" | |
# Initialize variables | |
questions_array = [] | |
z = [] | |
c = 0 | |
w = 0 |