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
@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
Rafael Mateo
@rafaelmateo
okks
Ill google it!
thanks for the info!!
Rafael Mateo
@rafaelmateo
hahahha I love this! thnks @travisboss
Ghost
@ghost~56c733f2e610378809c24d2c
its a big complicated to explain over gitter so it is usually easier to give a link to. so you can see you are using div classes and calling those out within nav. I have it on an old site and is pretty easy.
Yaroslav Newman
@YaroNew
Guys
Help with assignment pls.
CamperBot
@camperbot
no wiki entry for: with assignment pls
Yaroslav Newman
@YaroNew
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line

for ( var i=1; i> arr.lenght; i+5) {
  for (var j=0; j< arr[i].lenght; j++);
}

  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Modify function multiplyAll so that it multiplies the product variable by each number in the sub-arrays of arr
Ken Haduch
@khaduch
@YaroNew - you have misspelled ".length" in two places... And you are not doing any multiplications - you should be multiplying the individual array elements (in your inner loop) times the product variable to get a value to return. Because the provided code does return product;
Yaroslav Newman
@YaroNew
@khaduch can you give an example
Ken Haduch
@khaduch
@YaroNew - a couple questions - do you have an explanation why your outer for loop has a variable that is initialized to 1, and then adds 5 as the iteration value? (There is a problem there, in my opinion.) Secondly - how would you access the elements of the two-dimensional array - there should be a lesson that describes and teaches that. "Access MultiDimensional Arrays With Indexes " is the lesson. The hint is that in your inner loop, you would need a statement that uses the syntax arr[ something1 ][ something2 ]; where the two different somethings are values that you generate to index into the multi-dimensional array.
Walid Ashri
@walidashri
@YaroNew
var arr=[[1,2],[3,4],[5,6,7]];
arr[0][1]= 2;
Yaroslav Newman
@YaroNew
@khaduch Yeap. Thanks for reminding.
CamperBot
@camperbot
yaronew sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1843 | @khaduch |http://www.freecodecamp.com/khaduch
Yaroslav Newman
@YaroNew
@khaduch so I need to turn all code in else\if statements
?
@khaduch

function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line


for ( var i=0; i < arr.length; i++) {
  for (var j=0; j< arr[i].length; j++);
}

  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
here is how my code looks like now
Walid Ashri
@walidashri
@YaroNew inside 2nd for loop
product *=arr[i][j]
Yaroslav Newman
@YaroNew
@walidashri
function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line


for ( var i=0; i < arr.length; i++) {
  for (var j=0; j< arr[i].length; j++);
  product *=arr[i][j];
}

  // Only change code above this line
  return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Walid Ashri
@walidashri
@YaroNew :+1:
Yaroslav Newman
@YaroNew
Doen't wokr
work
multiplyAll([[1],[2],[3]]); should return 6
multiplyAll([[1,2],[3,4],[5,6,7]]) should return 5040
multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]);) should return 54
it returns null
Yaroslav Newman
@YaroNew
@walidashri any ideas?