Closed romebell closed 4 years ago
function checkWinner(player) {
resetBall();
if (player.score >= 10) {
delete ball.speed;
const newElement = document.createElement('p');
newElement.textContent = `${player.paddle} wins!`;
statement.appendChild(newElement);
}
}
function detectPaddleHit() {
let collisionPointBottomComputer = playerComputer.y + playerComputer.height;
let collisionPointTopComputer = playerComputer.y;
let ballPos = ball.y;
subtractBtn.addEventListener('click', (e) => {
e.preventDefault
const currentValue = Number(input.value);
input.value = currentValue - 1
document.getElementById('display').textContent = currentValue - 1
})
const removeComponent = (carousel, cb = () => null) => (
carousel.setState(({ tail, curr, ...rest }) => {
const { prev: newTail } = tail;
if (newTail) {
newTail.next = null;
if (curr === tail) { curr = newTail; }
tail = newTail;
}
return { ...rest, tail, curr };
}) && cb());
const myFunc = () => {
console.log(`IS THIS THING ON?`)
}
myFunc();
function() {
consolelog(helloworld)
}
http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write(req.url);
res.end();
}).listen(8080);
window.addEventListener('DOMContentLoaded', function () {
calculate();
});
let hi = "hello"
addButton.addEventListener('click', addfunction)
function addfunction(){
result += parseInt(input.value)
output.textContent = result
if (input.value < 0) {
output.style.color = 'black';
}
}
app.get('/',(req,res)=>{
const articles = [
{
title: 'Test Article',
createdAt: new Date(),
description: 'text description'
},
{
title: 'Test Article',
createdAt: new Date(),
description: 'text description'
}
]
res.render('index',{ articles: articles })
})
function codeSnippet(){
console.log('this is a code snippet');
}
const plus = document.getElementById('plus');
const minus = document.getElementById('minus');
const h1= document.querySelector('h1');
const input = document.querySelector('input');
let numb = 0;
h1.innerText=numb;
function up() {
document.getElementById('Input').stepUp(1);
}
function down() {
document.getElementById('Input').stepDown(1);
}
function handleBackground() {
if (yPosR === 0) {
yPos += bgScroll * 0.5;
ctx.drawImage(launchStage, 0, yPos, canvas.width, canvas.height);
ctx.drawImage(stage2, 0, yPos - 800, canvas.width, canvas.height);
ctx.drawImage(stars, 0, yPos - 1600, canvas.width, canvas.height);
}
if (yPos > 1600) {
if (repeatBG.y1 >= repeatBG.height) repeatBG.y1 = -repeatBG.height;
else repeatBG.y1 += bgScroll * 0.5;
if (repeatBG.y2 >= repeatBG.height) repeatBG.y2 = -repeatBG.height;
else repeatBG.y2 += bgScroll * 0.5;
ctx.drawImage(stars, 0, repeatBG.y1, canvas.width, canvas.height);
ctx.drawImage(stars, 0, repeatBG.y2, canvas.width, canvas.height);
}
}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main.css">
<title>Project One - Assessment</title>
</head>
<body>
subtraction.addEventListener('click', function(){
let result = parseInt(count.textContent) - parseInt(input.value)
document.querySelector('.count').textContent = result
if (result < 0) {
count.style.color = "red";
} else if (result > 0) {
count.style.color = "black";
}
})
document.getElementById('clear').addEventListener('click', function(){
document.querySelector('#tempToBeConverted').value = null;
document.querySelector('#result').innerHTML = "";
}
)
function minusFunction() {
result -= parseInt(input.value)
answer.innerHTML = result
if (result < 0) {
answer.style.color = 'red'
}
else if (result >= 0) {
answer.style.color = 'black'.
}
}
let animal = cat
console.log(cat)
async function delay(ms) {
return await new Promise(resolve => setTimeout(resolve, ms));
};
let play = async ()=>{
await delay(0);
playComputer();
await delay(5000);
startTimer();
playerGo();
await delay(4000);
let playerScore = comparePitches();
if (playerScore < 5) {
document.querySelector("#go").innerText = "Try again!";
} else if (playerScore >= 5) {
document.querySelector("#go").innerText = "You win!";
}
};
h1 {
color: black;
text-align: center;
}
output{
display: inline;
color: black
}
.divv {
display: inline;
margin: auto;
align-items: center;
text-align: center;
}
form{
background-color: rgba(3, 141, 141, 0.651);
}
body{
background-color: rgba(155, 1, 160, 0.767);
}
function addNumbers() {
let num1 = 2;
let num2 = 3;
console.log(num1);
return num1 + num2;
}
![Screen Shot 2020-11-12 at 12 38 18 PM](https://user-images.githubusercontent.com/71296393/98975510-31b4ad80-24e4-11eb-8637-035377e291f6.png)
add.addEventListener('click', function(){
integer = 1;
int.innerHTML = integer;
})
let threeLettersBack ='DEFGHIJKLMNOPQRSTUVWXYZABC';
console.log('teelettersback');
VM189:2 teelettersback
undefined
function getProduct() {
let num1 = 5
return num1}
getProduct()
document.querySelector('.subtract').onclick = function() {
var input = document.querySelector('.input').value;
console.log(input)
let integer = Number(input);
console.log(integer)
let output = currentValue - integer
console.log(output)
currentValue = output
if (currentValue < 0) {
number.style.color ='red'
} else {
number.style.color ='black'
}
input = null
number.textContent = currentValue
}
plus.addEventListener('click', function() {
number = number + parseInt(input.value);
display.textContent = number;
if (number < 0) {
display.style.color = 'red'
} else {
display.style.color = 'black'
}
})
const myName = "frank";
timerId = setInterval(moveDown, 1000)
function moveDown() {
undraw()
currentPosition += width
draw()
}
function addNumbers() {
let num1 = 2;
let num2 = 3;
console.log(num1);
return num1 + num2;
}
const frankCollins = 'Frank Collins'
@pmacaluso3
resolved
@pmacaluso3
nevermind, guess google gave me the wrong command
Hey, guys. I was unable to access nodemon, despite successfully installing it. As you can see in the screenshot below, I confirmed that it's been installed at the global level, but when I try to access it, I get zsh: command not found: nodemon
.
I think it has something to do with correcting my $PATH
in my .zshrc
file, but I haven't quite figured it out. I'm working on it now, but wasn't sure if you had a quick fix for me.
My node_modules is still showing in ls
Hey, guys. I was unable to access nodemon, despite successfully installing it. As you can see in the screenshot below, I confirmed that it's been installed at the global level, but when I try to access it, I get
zsh: command not found: nodemon
.I think it has something to do with correcting my
$PATH
in my.zshrc
file, but I haven't quite figured it out. I'm working on it now, but wasn't sure if you had a quick fix for me.
I finally got it working. I had to reinstall Node (I did it via Node Version Manager this time), as well as Nodemon, but I'm up and running now. Definitely need to dig into this more when I get timeβshell profiles and where programs are saved is still a little hazy to me.
Admin π - [admin] is looking into it π - [admin] Answer issue. Looks good. Code works.
Students π - [student] I get it! π - [student] Still confused π - [student] A simple error π - [student] My code now works
Admin/Students β€οΈ - [student/admin] Love the topic or code snippet π - [student/admin] Code didn't work