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
Salman Shahid
@salman-shahid
Your whichQuotes variable is defined locally.
If you want to use it outside of that function you'll have to define it globally. so whichQuotes = 0; before the function and then remove the var from the function.
DebugginOut
@DebugginOut
oh snap
thanks
it works
Well, since it's inside codepen it doesn't, but when I run it from a file on my computer in my browser, it does
Brett Guillory
@kurzninja
a better way to do it would be to pass the variable around as an argument to other functions instead of making a global variable
Salman Shahid
@salman-shahid
Yeah, that's a better idea. Also, thanks for the link kurz
Salman Shahid
@salman-shahid

Hey @kurzninja When I use:

$(".ops").click(function(handle) {
  console.log(handle);
});

I see an object displayed how do I access the data inside it?

https://jsfiddle.net/himynameissal/0z1mpm7s/

Salman Shahid
@salman-shahid
Nevermind, I'm making progress now.
Brett Guillory
@kurzninja
I was gonna say, what object?
It should just execute the function
Salman Shahid
@salman-shahid
Yes, with a object given from the click object.
I'm doing this now:
$(".ops").click(function(handle) {

    //var cool = handle;
  console.log(handle.currentTarget.attributes.id);
});
To retrieve id of what I clicked
DJ
@qualitymanifest
console.log($(this).text()) would work better overall maybe, since you can't have ID's start with a number
Salman Shahid
@salman-shahid
@qualitymanifest Good idea.. I already gave my elements worded ids before
DJ
@qualitymanifest
@mynameissal yeah, but when you're actually doing math you'll need numbers, not words
Salman Shahid
@salman-shahid
oh true!
JackeL
@jackel27
Can anyone help me with Json?
Rex Schrader
@SaintPeter
@jackel27 Sure, what's the trouble?
sigursiguros
@sigursiguros
HI guys I've made some changes to my calculator. Would you please review. Thanks.
JackeL
@jackel27
@SaintPeter so, I have a url, I am just confused on how to use it correctly... http://www.icndb.com/api/
JackeL
@jackel27
@SaintPeter mind if I PM you?
Rex Schrader
@SaintPeter
@jackel27 Sure
sigursiguros
@sigursiguros
@jackel27 @mynameissal
@jnmorse
JackeL
@jackel27
@SaintPeter Thanks
CamperBot
@camperbot
jackel27 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: jackel27 already gave saintpeter points
Ankit Panwar
@coderNoob
Minimax algorithm
Can anyone please help me understand the concept of depth in this algorithm? Does the author mean that we need to check for the number of empty squares left on the board?
In the last example the depth reads as 0, 1, 2, 3 and 4. I didn't get it.
Salman Shahid
@salman-shahid
@sigursiguros You shouldn't be able to press "." again if "." is already pressed once
Also, 3-6 gives -9 when it should be -3
Rex Schrader
@SaintPeter
@coderNoob Imagine a blank board - Now make a mark. Now there are 8 possible second moves. for each of those 8 moves there are 7 possible next moves, and so on. Each "level" of moves that you go down is a level of depth. There are no more than 8 levels of depth, for a total of 9^3 possibles boards (duplicates included).
Err . . maybe 3^9
SaintPeter @SaintPeter can't remember
Vinodh Thiagarajan
@VinodhThiagarajan1309
@VinodhThiagarajan1309
Anyone here who can help me with media query ? I was wondering how can i create an issue to fix it using media query but now Im doing the Calculator project
the UI goes crazy when the window is resized
http://codepen.io/VinodhThiagarajan/full/obdRbK
sigursiguros
@sigursiguros
@mynameissal how do I do this?
Salman Shahid
@salman-shahid
@sigursiguros Check if your line contains a dot if it doesn't then add a dot. If it does then don't do anything.
I'm not sure about the 3-6 = -9
sigursiguros
@sigursiguros
@mynameissal can I use a regex to achieve this?
Salman Shahid
@salman-shahid
It depends on how you wrote your solution.
You could do it with simple if then else
I am going to take a nap. Remember you don't want two dots!
Ankit Panwar
@coderNoob
@SaintPeter So depth = number of possible moves left to make which is also the number of blank squares left on the board?
sigursiguros
@sigursiguros
Hi guys, I"ve fixed my calculator, woudl you please review.
LT
@ltr7
Looking good @sigursiguros. I like the classic layout. I did notice dividing a number by zero returns the original number.