Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Daniel
@DanielMW34
@risafletcher OMFG..... thank you... I have been losing my mind over this
CamperBot
@camperbot
:cookie: 4 | @risafletcher |http://www.freecodecamp.com/risafletcher
danielmw34 sends brownie points to @risafletcher :sparkles: :thumbsup: :sparkles:
Daniel
@DanielMW34
@risafletcher do you have a line number or is it repeated over and over ?
Ken Haduch
@khaduch
@DanielMW34 ".indexOf" - misspelling
Many lines in the code you posted
Risa Fletcher
@risafletcher
@DanielMW34 the first 3 ifs in your for loop in the checkPlayerVictory function
Daniel
@DanielMW34
@risafletcher @khaduch thank you ... I have probably copied/pasted this mistake into checkComputerVictory as well.... I can't imagine how long I would have gone on rewriting and restructuring the code if it had not been for you catching that
CamperBot
@camperbot
danielmw34 sends brownie points to @risafletcher and @khaduch :sparkles: :thumbsup: :sparkles:
:warning: danielmw34 already gave risafletcher points
:star2: 1842 | @khaduch |http://www.freecodecamp.com/khaduch
Risa Fletcher
@risafletcher
@DanielMW34 I hope it helps! If there are more errors I'm happy to help! :)
Daniel
@DanielMW34
@risafletcher there are!!!!
Ken Haduch
@khaduch
@DanielMW34 - the browser developer console would help you with non-existent functions like this. Open it up when you are using the site
Risa Fletcher
@risafletcher
@DanielMW34 Let's run through your bugs. If you give us a list, I'm sure we're all happy to help identify and tackle them
Daniel
@DanielMW34
@risafletcher I corrected the indexOf and that apparently has made a difference however, the program is not executing as I would like it. First thing I noticed.. this section is not effecting the display...
if (ticTacToe.length == 3) {
          playerOneScore += 1;
          winner = "Player1";
          $("#test7").html(playerOneScore);
          $("#1").html("Y");
          $("#2").html("O");
          $("#3").html("U");
          $("#4").html("-");
          $("#5").html("-");
          $("#6").html("-");
          $("#7").html("W");
          $("#8").html("I");
          $("#9").html("N");
          break;
        }
Risa Fletcher
@risafletcher
=== are best instead of just two
Daniel
@DanielMW34
@risafletcher bug #2, computer went first, I went second, computer then picked 3rd and 4th... apparently there is a bug which is not waiting its turn for me
@risafletcher how do you want me to send these bugs to you? A private message list?
Risa Fletcher
@risafletcher
@DanielMW34 Sure! I'm actually in class so if you need immediate help, I'm sure someone online right now can take over
Daniel
@DanielMW34
@risafletcher Let me get the list made, that alone would help me identify what all needs fixing. Will you be free after your class? If so, around what time / timezone ?
Risa Fletcher
@risafletcher
so, it sounds like you need the computer's turn/function to hand off to user input each time
I'm in PST. I'll be out in about an hour :/
Ken Haduch
@khaduch
@DanielMW34 - it looks like it is allowing about two moves, and then it clears the screen of X and O marks? Are you seeing that?
Daniel
@DanielMW34
@khaduch I have seen MANY different variations of mistakes, including that one.
Ken Haduch
@khaduch
@DanielMW34 - or it's doing something else... i have a theory, if I didn'tn't already find this for you?
Daniel
@DanielMW34
@khaduch I wish I could send you a screen shot of what I currently see.... computer has top 3, bottom 3, left side all marked out... took about 4 squares at once...
@khaduch I would love to know your theory
Ken Haduch
@khaduch
@DanielMW34 - I think that in the playerTurn function, you are assigning multiple click handlers on your squares #1, #2, etc. The behavior that I just saw, where a couple clicks worked and then it seemed to linearly increase in the number of marks put on the board fits a pattern that I have seen a couple times recently. You do not want to assign $("#1").on("click", function() {and all of the following each time you run that playerTurn function, if it is invoked multiple times. One time to assign the click handler should be all that you do. You might want to have a flag that will tell you that youve already set a click handler and not do it again. Does that make sense? I didn't try to test it, but that's my theory... I'll be back in a while
lacey irvin
@laceyIrvin
how can i achieve this for my portfolio. I really love the simplicity but I don't know where to start
http://josephgochua.com/
Daniel
@DanielMW34
@khaduch I think I see where you are going, wondering if I should restructure this so instead of playerTurn() containing all the click functions, the click functions would exist outside playerTurn() and, perhaps, playerTurn() simply runs an analysis to see what squares have been used and, if they have been used, disables their "clickability" or, vice versa, they are "un-clickable" by default and, only playerTurn() can make them "clickable"
Ken Haduch
@khaduch
@DanielMW34 - that might be the best way to go - the thing is that you have some variables in that function and they might not be in scope if you define the click handlers outside? I guess that's one problem that I can foresee? You can probably figure out a way around that to make those values accessible. The main thing is that you do not want to create multiple click handlers. You can probably do it all in one with other checks to determine which cell was clicked - fetch the ID value and get the number, use that to index into an array to get information related to that square, etc. You aren't disabling any of them at this point, are you? That might be something helpful once you have a cell occupied...
trying to get this to iterate over the object
Daniel
@DanielMW34

@khaduch
"the thing is that you have some variables in that function and they might not be in scope if you define the click handlers outside?" ---- do you mean this might be the case if I change the design to have each <div> clicker call an individual function?

"The main thing is that you do not want to create multiple click handlers." ----- I'm not 100% clear on what multiple click handlers are...?

"You aren't disabling any of them at this point, are you?" ---- correct, I am not disabling anything at this point. (even some of the things I thought I was disabling are not disabling). In order to disable something, the example below should work AND, the line beneath would "re-enable" the clicking correct?

$("#playX").attr("disabled", "disabled");
$("#playX").removeAttr("disabled");
Ken Haduch
@khaduch
@DanielMW34 - I'll get back to you soon, okay?
Daniel
@DanielMW34
@khaduch yes, I am going to head out for 20 mins to print out some of this code on paper so I can look at it in it's entirety.
@khaduch just message me whenever you are ready, and thank you
CamperBot
@camperbot
danielmw34 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: danielmw34 already gave khaduch points
Risa Fletcher
@risafletcher
@laceyIrvin I'm on mobile; can you S/s me the desktop? The appeal seems to be mostly the typeface he is using
Rafael Mateo
@rafaelmateo
hello
Howdo I put a navigation bar in the front end project?
Ghost
@ghost~56c733f2e610378809c24d2c
Rafael Mateo
@rafaelmateo
The thing about that is that I dont wanna use links, I want people to click on it and go do THAT section down the page, because it is just 1 page
@travisboss
@travisboss but thanks!
CamperBot
@camperbot
rafaelmateo sends brownie points to @travisboss :sparkles: :thumbsup: :sparkles:
:cookie: 286 | @travisboss |http://www.freecodecamp.com/travisboss
Ghost
@ghost~56c733f2e610378809c24d2c
@rafaelmateo you would be looking at #tags this is done with bootstrap