Adventures though JavaScript

This blog will be all my adventures through JavaScript with slight descriptions of key concepts of the code i do.

0 comments
3 entries
Advertisement
MarklHarrison9
January 28, 2018
Calculator

This is a simple Calculator

You set up the first variable the operator you want to use and the 2nd variable. After that you hit Try it and it will run though a switch case to check which operator to use and plug in both variables to calculate.

 

switch(y){
	case "+":
	A= parseInt(x…
701 views
MarklHarrison9
January 28, 2018
Battleship Sim

Small Battleship Simulator in JavaScript

above is the UI that i decided to use. you have 9 spots for yourself and the AI. At the start you pick 3 spots to be your ships.

Each spot is numbered 1-9 and at the start of the document the CPU picks both where it wants it's ships and where …

785 views
MarklHarrison9
January 28, 2018
Slot machine

This program emulates a slot machine. 

 

using math it will pick a random number 3 times and put it into a variable X Y and Z.

var x = Math.floor((Math.random() * 5) + 1);
var y = Math.floor((Math.random() * 5) + 1);
var z = Math.floor((Math.random() * 5) + 1);

If you hit the wi…

1,566 views
Advertisement

Popular Blogs

shawnhar
Generalist
101 Entries
9 Followers
15 Entries
10 Followers
johnhattan
Programmer
1,277 Entries
47 Followers
ApochPiQ
Generalist
628 Entries
44 Followers
dgreen02
Generalist
338 Entries
56 Followers
Advertisement