Battleship

I created the game of battleship by forming a while loop which ran turns of the game, with user and computer guesses, until a grid lacked either battleship. To do so, I created boolean variables, and tested their values every iteration of a loop. Once these variables became false, I terminated and printed a winner.

Battleship

Player vs AI there are 20 rounds each player has a 1 by 1 ship

DNA converter

This converts the DNA, which is randomly generated, to RNA, then into amino acids, then into proteins.

DNA to RNA to Amino Acids to Protein

This program simulates the process which DNA turns into a protein. The DNA strand is hard-coded.

Classroom Attendance

This is a classroom attendance sheet that marks the attendance of 6 students. The only options are absent or present. You can see a person's status in the table.

Rock, Paper, Scissors Game

A Rock, Paper, Scissors game running on a website made with HTML, CSS, Javascript.

Attendance Sheet

I made a simple table, and if the student is marked, they are assumed present. If they are marked, it is added to absent tally.

OO RPS

Object oriented RPS implementation

Rock Paper Scissors

The computer randomly selects a number which corresponds to rock paper or scissors. Then the program compares all the possible combinations to determine who the winner is.

Rock Paper Scissors

This is a game of rock paper scissors with the CPU. The user is prompted to choose rock, paper, or scissor and then the CPU randomly selects one of the three. Afterwards the winner is outputted to the console. The main part of the code was the nested "if" statements to check for all the possible outcomes that could result between the user and the CPU.

var player1 = prompt("Choose Rock, Paper, or Scissors "); var x = Math.random(); if (x < 1/3){ x = "rock"; } else if(x <= 2/3) { x = "paper"; } else { x = "scissors"; } var result = function(a, b) { if(a === b) { return "It's a draw"; } if(a === "rock") { if(b === "scissors") { return "rock wins"; } else { return "paper wins"; } } if(a === "paper") { if(b === "rock") { return "paper wins"; } else { if(b === "scissors") { return "scissors wins"; } } if(a === "scissors") { if(b === "rock") { return "rock wins"; } else { if(b === "paper") { return "scissors wins"; } } } } }; console.log("Player1: " + player1); console.log("x: " + x); result(player1, x);

Rock, Paper, Scissors

Game of rock paper scissors; I used a random number generator to create random choices for the computer, I then turned these numbers to Strings once they had been picked. This allowed for me to randomly select "rock" "paper" or "scissors" for the computer, and then use those Strings to test if the player or computer won the round.

Classroom Attendance Management App

This is my Classroom Attendance Management App coded using HTML, CSS, and JavaScript. The website is hardcoded for a classroom of 6 students.

1 2 ... 25