Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Blackjack in javascript

    Hello. I tried to wrote a Blackjack in javascript (follow youtube user RoyBrush and his series Let's Code). Here's code. When I click start always pops up an alert "player 01 wins." In addition each time i click 'hit' or 'stick' pops up an alert. Can someone tell me what's wrong? Sorry for my bad english.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    I'm sorry, but there's just some very bad logic in that code.

    There are no coding errors, per se (that is, no errors show up in the error console), but the logic of the game just makes no sense.

    In addition, the user interface and the game play isn't very good.

    I would go find a different version with better code. That code just isn't worth trying to fix, in my opinion.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, I watched the entire series to the end and everythings looks fine now :] I'm not sure of 'if' conditions in victorycheck function but it seems that the game works well. Code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •