that assignment was fun
This commit is contained in:
parent
0782b2c775
commit
bbce21cf8b
4
.gitignore
vendored
4
.gitignore
vendored
@ -19,4 +19,8 @@
|
|||||||
/Assignments/JavaScript/Chapter3Examples/nbproject/private/
|
/Assignments/JavaScript/Chapter3Examples/nbproject/private/
|
||||||
/Assignments/JavaScript/lab12js/nbproject/private/
|
/Assignments/JavaScript/lab12js/nbproject/private/
|
||||||
/Assignments/JavaScript/MP09_CalebFontenot/nbproject/private/
|
/Assignments/JavaScript/MP09_CalebFontenot/nbproject/private/
|
||||||
|
<<<<<<< Updated upstream
|
||||||
/Assignments/JavaScript/MP10_CalebFontenot/nbproject/private/
|
/Assignments/JavaScript/MP10_CalebFontenot/nbproject/private/
|
||||||
|
=======
|
||||||
|
/Assignments/JavaScript/lab14js_CalebFontenot/nbproject/private/
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
3
Assignments/JavaScript/lab14js_CalebFontenot/.bowerrc
Normal file
3
Assignments/JavaScript/lab14js_CalebFontenot/.bowerrc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"directory": "public_html/bower_components"
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/Gruntfile.js to edit this template
|
||||||
|
*/
|
||||||
|
module.exports = function (grunt) {
|
||||||
|
// Project configuration.
|
||||||
|
grunt.initConfig({
|
||||||
|
});
|
||||||
|
};
|
13
Assignments/JavaScript/lab14js_CalebFontenot/bower.json
Normal file
13
Assignments/JavaScript/lab14js_CalebFontenot/bower.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "lab14js_CalebFontenot",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "path/to/main.css",
|
||||||
|
"ignore": [
|
||||||
|
".jshintrc",
|
||||||
|
"**/*.txt"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
}
|
||||||
|
}
|
10
Assignments/JavaScript/lab14js_CalebFontenot/gulpfile.js
Normal file
10
Assignments/JavaScript/lab14js_CalebFontenot/gulpfile.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/gulpfile.js to edit this template
|
||||||
|
*/
|
||||||
|
|
||||||
|
var gulp = require('gulp');
|
||||||
|
|
||||||
|
gulp.task('default', function () {
|
||||||
|
// place code for your default task here
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
file.reference.lab14js_CalebFontenot-public_html=public_html
|
||||||
|
file.reference.lab14js_CalebFontenot-test=test
|
||||||
|
files.encoding=UTF-8
|
||||||
|
site.root.folder=${file.reference.lab14js_CalebFontenot-public_html}
|
||||||
|
test.folder=${file.reference.lab14js_CalebFontenot-test}
|
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.web.clientproject</type>
|
||||||
|
<configuration>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
|
||||||
|
<name>lab14js_CalebFontenot</name>
|
||||||
|
</data>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "lab14js_CalebFontenot",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"keywords": ["util", "functional", "server", "client", "browser"],
|
||||||
|
"author": "caleb",
|
||||||
|
"contributors": [],
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>NUMBER ROUNDER</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script>
|
||||||
|
var input = prompt("Enter a number.");
|
||||||
|
var decimal = input - Math.trunc(input);
|
||||||
|
var output;
|
||||||
|
if (decimal > .5) {
|
||||||
|
output = Math.trunc(input) + 1;
|
||||||
|
var round = "up";
|
||||||
|
} else {
|
||||||
|
output = Math.trunc(input);
|
||||||
|
var round = "down";
|
||||||
|
}
|
||||||
|
document.write(input + " rounded " + round + " is " + output);
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
</html>
|
@ -0,0 +1,103 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TODO supply a title</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script>
|
||||||
|
function design1() {
|
||||||
|
var input = prompt("Enter a greeting.");
|
||||||
|
var startEnd = "";
|
||||||
|
for (let i = 0; i < input.length + 2; i++) {
|
||||||
|
startEnd += "*";
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML = startEnd + "<br>";
|
||||||
|
document.getElementById("outputP").innerHTML += "*" + "<br>";
|
||||||
|
document.getElementById("outputP").innerHTML += "* " + input + "<br>";
|
||||||
|
document.getElementById("outputP").innerHTML += "*" + "<br>";
|
||||||
|
document.getElementById("outputP").innerHTML += startEnd;
|
||||||
|
|
||||||
|
}
|
||||||
|
function design2() {
|
||||||
|
var input = prompt("Enter a greeting.");
|
||||||
|
var height = (input.length * 2) + 6;
|
||||||
|
var mid = Math.trunc(height / 2) + 1;
|
||||||
|
if (height % 2 == 0) {
|
||||||
|
height++;
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML = "";
|
||||||
|
for (let i = 0; i < height; i++) {
|
||||||
|
if (mid == i) { //Determine if we're in the middle of the triangle
|
||||||
|
document.getElementById("outputP").innerHTML += "**" + input + "**";
|
||||||
|
} else {
|
||||||
|
for (let j = 0; j < i; j++) {
|
||||||
|
document.getElementById("outputP").innerHTML += "*";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML += "<br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function design3() {
|
||||||
|
var input = prompt("Enter a greeting.");
|
||||||
|
var height = (input.length * 2) + 6;
|
||||||
|
var mid = Math.trunc(height / 2) + 1;
|
||||||
|
if (height % 2 == 0) {
|
||||||
|
height++;
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML = "";
|
||||||
|
if (mid % 2 == 1) { // Skip a line if odd
|
||||||
|
var subOffset = 1;
|
||||||
|
var addOffset = 0;
|
||||||
|
} else {
|
||||||
|
var subOffset = 0;
|
||||||
|
var addOffset = 1;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < mid - addOffset; i++) {
|
||||||
|
for (let j = 0; j < i; j++) {
|
||||||
|
if (i % 2 == 1) {
|
||||||
|
if (i != (mid - 1)) {
|
||||||
|
if (i == 0 || (j == 0 || j == (i - 1))) { // Check if we're at the beginning or end of the line
|
||||||
|
document.getElementById("outputP").innerHTML += "*";
|
||||||
|
} else {
|
||||||
|
document.getElementById("outputP").innerHTML += " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML += "<br>";
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML += "* " + input + " *<br>";
|
||||||
|
for (let i = mid - subOffset; i > 0; i--) {
|
||||||
|
for (let j = 0; j < i; j++) {
|
||||||
|
if (i % 2 == 1) {
|
||||||
|
if (j != (mid - 1) || (j != mid)) {
|
||||||
|
if ((i == 0 || (j == 0 || j == (i - 1)))) { // Check if we're at the beginning or end of the line
|
||||||
|
document.getElementById("outputP").innerHTML += "*";
|
||||||
|
} else {
|
||||||
|
document.getElementById("outputP").innerHTML += " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById("outputP").innerHTML += "<br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Select a design!</h1>
|
||||||
|
<p id="outputP"></p>
|
||||||
|
<button onclick="design1()">Design 1</button>
|
||||||
|
<button onclick="design2()">Design 2</button>
|
||||||
|
<button onclick="design3()">Design 3</button>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
Click nbfs://nbhost/SystemFileSystem/Templates/Other/html.html to edit this template
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TODO supply a title</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>TODO write content</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user