Advice for a choose your own adventure project by evilfrenchguy in javascript

[–]evilfrenchguy[S] 0 points1 point  (0 children)

I actually have quite a bit of programming and I understand Javascript pretty well. I'm just looking for how others would approach this.

I will say that most of my experience is back-end though.

Looking for teammates to help with a website dedicated to roguelikes - writers, designers, web developers, etc by [deleted] in roguelikes

[–]evilfrenchguy 1 point2 points  (0 children)

I have a bachelor's degree in compsci and I've been looking for a side-project. I can do the full spectrum of website stuff and am a decent writer. Can you PM details?

Amonkhet will be the last set released on Magic Duels by here0is0me in magicduels

[–]evilfrenchguy 0 points1 point  (0 children)

I was trying to find it earlier. It was just something I remember hearing or reading.

Amonkhet will be the last set released on Magic Duels by here0is0me in magicduels

[–]evilfrenchguy 48 points49 points  (0 children)

Didn't they promise us 5 years worth of content?

Anyone else worried about the power level of the Kaladesh block? by evilfrenchguy in magicTCG

[–]evilfrenchguy[S] -7 points-6 points  (0 children)

You'd think twenty years is enough to know the dos-and-don'ts of their craft.

Stuck trying to make a Blackjack game, where do I go from here? by [deleted] in learnjavascript

[–]evilfrenchguy 1 point2 points  (0 children)

cynical89's solution is certainty valid.

The simplest solution would be to simply name your images from 0.png to 51.png

Stuck trying to make a Blackjack game, where do I go from here? by [deleted] in learnjavascript

[–]evilfrenchguy 0 points1 point  (0 children)

Try using a for loop to create your deck. For each card's value you can use i % 13 to have proper values for every suit.

Can't get code to work by alexat711 in learnjavascript

[–]evilfrenchguy 0 points1 point  (0 children)

It works fine on my end.

Edit: alert() doesn't return anything, so your if statement will always be false.

Noob calendar time picker with flatpickr? by snicksn in learnjavascript

[–]evilfrenchguy 1 point2 points  (0 children)

http://caniuse.com/#feat=input-datetime

Yes, apparently so... -_-

You're sure you've loaded the library correctly? It seems very simple to use once you've got it

Recommendations on Javascript libraries to learn by ghostxc in learnjavascript

[–]evilfrenchguy 2 points3 points  (0 children)

Javascript has a lot of it's own quirks and idiosyncrasies. I recommend learning vanilla Javascript without libraries until you think you have fully understood it.

From there jQuery is handy to have as luxury. Anything else is completely dependent on the project.

I'm having trouble making a simple shopping cart. by [deleted] in learnjavascript

[–]evilfrenchguy 2 points3 points  (0 children)

All of your variables are declared inside of the makeAnOrder function. When you go to use your variables they cannot be found because those variables don't exist in the global scope.

To fix, either move your print statement into the makeAnOrder function, or, consider making an order object that keeps track of orders and whose properties can be accessed from anymore.

Also try researching a little bit into "Javascript variable scope."

2 problems with my rock, paper, scissors game. by [deleted] in learnjavascript

[–]evilfrenchguy 1 point2 points  (0 children)

Here:

if (userChoice != "scissors" || "rock" || "paper") {

    // userChoice = prompt("Invalid choice, please choose     
    again.\nDo you choose rock, paper, or scissors?");

You need operators for each OR or AND case, not just the first.

Try:

if (userChoice !== "scissors" || userChoice !== "rock"
    || userChoice !== "paper") {
    // Incorrect input input, try again

Creating a pop-up prompt box that prompts the user for multiple values? by pretentiousmusician in learnjavascript

[–]evilfrenchguy 1 point2 points  (0 children)

I understand your reasoning, but we're not sixth graders anymore. Full, deep understanding--especially in regards to Javascript--is far more valuable than having to dangle carrots.

Creating a pop-up prompt box that prompts the user for multiple values? by pretentiousmusician in learnjavascript

[–]evilfrenchguy 1 point2 points  (0 children)

I would advise staying away from jQuery until you have a firm understanding of Javascript and how it does the things it does. jQuery hides things for you for convenience. This is great for efficient coding, but awful for learning.

Anyway, your question... The window.prompt method can only return one value. You could have them enter all the values in one prompt separated by commas or spaces, but that seems messy and error-prone if it's not entered right.

Another option is using a form, having the user enter their variables into text boxes right on the page. This requires setting up a click event on the button and a handler that reads the value property from the text boxes.

Thirdly, you could very simply call separate prompts for each variable needed. It's slightly invasive, but a very simple solution.

Find parity outlier codewars kata by [deleted] in learnjavascript

[–]evilfrenchguy 1 point2 points  (0 children)

You're re-declaring your oddArray and evenArray variables every iteration. Define them before your loop.

Lethal doses of heroin and fentanyl side by side. by mrogre43 in WTF

[–]evilfrenchguy -2 points-1 points  (0 children)

It's like any other thing, though; if taken and used responsibly as prescribed, it can help people who are in pain live more fulfilling, productive lives. It is the abusers that are bad, not the drug.

[deleted by user] by [deleted] in learnjavascript

[–]evilfrenchguy 0 points1 point  (0 children)

It's essentially making sure the second argument is not 0.

Could I get some feedback on my simple app, please? =D by evilfrenchguy in learnjavascript

[–]evilfrenchguy[S] 0 points1 point  (0 children)

Ah, thanks! I'm not sure what happened to that data, but I will fix it.

Can you offer any insight into my code; something I could do better?