sei-ec-remote / project-1-issues

Open new issues here
1 stars 2 forks source link

Project 1 - Memory Game #231

Closed Tessabaxter12 closed 9 months ago

Tessabaxter12 commented 9 months ago

What's the problem you're trying to solve?

My shuffle isn't working My count down clock isn't working I can't flip the cards

Post any code you think might be relevant (one fenced block per file)

//Card Array
const cardFronts = [
  { name: "Dolphin", image: ("../images/Dolphin.png")},
  { name: "Star Fish", image: ("../images/Star Fish.avif")},
  { name: "Shark", image: ("../images/Shark.avif")},
  { name: "Octopus", image: ("../images/Octopus.avif")},
  { name: "Sea Horse", image: ("../images/Sea Horse.avif")},
  { name: "Turtle", image: ("../images/Turtle.webp")},
  { name: "JellyFish",  image: ("../images/JellyFish.avif")},
  { name: "Stingray", image: ("../images/Stingray.webp")},
  { name: "Crab", image: ("../images/Crab.jpeg")}
];

//Timer & Restart Button var time; var ele = document.getElementById('time'); (function (){ var sec =0; time = setInterval(()=>{ ele.innterHTML = '00:'+sec; sec ++; }, 1000) // mil seconds })() function restart(){ clearInterval(time); }

If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?

Is that how you would make the array for the front of the cards? I was trying to use sea images saved in the file and use the relative path?

What is your best guess as to the source of the problem?

I have to many mistakes to figure out why it isn't working

What things have you already tried to solve the problem?

read about items on MDN, researched on google, read you shuffle on replit (made it worse)

Paste a link to your repository here

https://github.com/Tessabaxter12/Memory_Game/activity

nayaba commented 9 months ago

The path is correct, but remove the parenthesis. Also, I hate to break it to you, but .webp and .avif images probably won't show up - look for .jpg/.jpeg, .gif, or .png.

The countdown timer you've pasted here is very close, but it needs to be wrapped in a function and invoked. We've already talked about modifying it.

nayaba commented 9 months ago

Check out this repl for some guidance on getting your card flipping set up.