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
<!-- Created for Code Fellows Foundations 2 as a working demonstration of preferredName()--> | |
<html> | |
<script> | |
var firstName = prompt("Please enter a first name: "); | |
var lastName = prompt("Please enter a last name: "); | |
var preferredName = function (firstName,lastName) { | |
if (firstName || lastName) { | |
alert( ((firstName && lastName) ? false : firstName || lastName)); | |
} else { |
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> | |
var debugMode = false; | |
function Game(tries) { | |
this.triesAllowed = tries; | |
var userGuess = 0; | |
var gameWon = false; |
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> | |
/*Random password generator | |
Set length to desired password length | |
Tell it if you want to include letters, capital letters, numbers, and symbols | |
Tell it if the password MUST require a capital letter, number, or symbol | |
Drag into browser to generate a password | |
*/ | |
var length = 10; | |
var lettersAllowed = 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
<script> | |
//global var set up | |
var debugMode = false; | |
var userGuess = 0; | |
var gameWon = false; | |
var triesUsed = 0; | |
var triesAllowed = 2; | |
var triesRemaining = triesAllowed; |
NewerOlder