Skip to content

Commit

Permalink
My first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lizzy985 committed Jun 4, 2024
0 parents commit 7980049
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
39 changes: 39 additions & 0 deletions FeelingLoopy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>CSV Parser in JavaScript</h1>
<script>
var s = "ID,Name,Occupation,Age\n42,Bruce,Knight,41\n57,Bob,Fry Cook,19\n63,Blaine,QuizMaster,58\n98,Bill,Doctor's Assistant,26";
var cells = [];
cell = "";
for (i = 0; i < s.length; i++) {
if (s[i] == "," || s[i] == "\n") {

cells.push(cell);
cell = "";

continue;
}
cell += s[i];
// console.log(cells);
// console.log(cell);

}
cells.push(cell);
// console.log(cells);
for (i = 0; i < cells.length / 4; i++) {
console.log(
cells[4 * i],
cells[4 * i + 1],
cells[4 * i + 2],
cells[4 * i + 3]
);
}
</script>
</body>
</html>
30 changes: 30 additions & 0 deletions FizzBuzz.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fizz Buzz</title>
<!-- <script src="./FizzBuzz.js" defer></script> -->
</head>
<body>
<h1>Fizz Buzz in JavaScript</h1>
<script>
// Loop through all numbers from 1 to 100.
// If a number is divisible by 3, log “Fizz.”
// If a number is divisible by 5, log “Buzz.”
// If a number is divisible by both 3 and 5, log “Fizz Buzz.”
// If a number is not divisible by either 3 or 5, log the number.
for(let i = 1; i <= 100; i++) {
if(i % 3 == 0 && i % 5 == 0){
console.log("Fizz Buzz.");
}else if(i % 5 == 0){
console.log("Buzz.");
}else if(i % 3 == 0) {
console.log("Fizz.");
}else {
console.log(i);
}
}
</script>
</body>
</html>
26 changes: 26 additions & 0 deletions PrimeTime.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Prime Time</h1>
<script>
var n = 8;
for (i = n + 1; ; i++) {
isPrime = true;
for (j = 2; j < i; j++) {
if (i % j == 0) {
isPrime = false;
}
}
if (isPrime == true) {
console.log(i);
break;
}
}
</script>
</body>
</html>

0 comments on commit 7980049

Please sign in to comment.