Skip to content

Instantly share code, notes, and snippets.

View devlemire's full-sized avatar
🎯
Focusing

James Lemire devlemire

🎯
Focusing
  • FLBlue
  • Port Orange, FL
View GitHub Profile
var selection = ["Rock", "Paper", "Scissors"];
var player = playerChoice();
var computer = computerChoice();
console.log(compare(player, computer));
function playerChoice() {
var choice;
do {
choice = prompt("Rock(1), Paper(2), or Scissors(3)?").toLowerCase();
var selection = ["Rock", "Paper", "Scissors"];
var player = playerChoice();
var computer = computerChoice();
console.log(compare(player, computer));
function playerChoice() {
var choice;
do {
choice = prompt("Rock(1), Paper(2), or Scissors(3)?").toLowerCase();
<!DOCTYPE html>
<head>
<title>CSS Practice</title>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div id="header">
<h1>CSS Practice</h1>
//make a function that takes in a string and capatalizes the first letter of every word and lowercase the rest
function capFirstLetter(str) {
str = str.toLowerCase().split(' ');
for(var i in str) {
str[i] = str[i].split('');
}
for(var j in str) {
var holder = str[j][0].charAt(0).toUpperCase();
str[j][0] = holder;
str[j] = str[j].join('');