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
Tom
@moT01
kinda supposed to be like that ^^
Kelsey
@iverunamok
@moT01 cool, I will change that... I am super new at this, and would love any and all feedback to make the project better!
Tom
@moT01
i understand
we've all been there
theres a drop down arrow/menu in each section of codepen with an analyze option - shows some errors
sharkantropo
@sharkantropo
@alpox When in a board AI wins, which plays with 'O',minmax is calculated by a base of -10 plus the amount of the AI moves made only during the predictions. It resets to 1 everytime user makes a play. When player wins, is calculated with a base of 10 minus the amount of AI moves. It's all over the place because I coded in such a way that calculates minmax and evaluates victory condition everytime a new board is generated.
@alpox wish i could sort this out in a more efficient and reader friendly way too.
alpox
@alpox
@sharkantropo Okay... i don't exactly know what you mean with base of -10 plus something :D May work too, idk. But for my understanding, minmax only needs 2 states (good/bad, -1/1 or whatever) for describing a win/loose depending on the board state. (For tic-tac-toe specifically)
Also, you don't need multiple boards. There is no need to save any in between, this only takes up memory and makes things very hard to track
You can operate on just one board actually
keymaster777
@keymaster777
Hey guys I came across something that I'd like to use an image map for and I found this resource http://thenewcode.com/760/Create-A-Responsive-Imagemap-With-SVG I think i'll try and do it the way listed in the article but the problem is I have no idea how to work with svg and my knowledge of SVG's is very basic. Does anyone have a link or resource that put me in the right direction?
alpox
@alpox
To elaborate: you only need 2 state because you bubble down recursively until you set all stones on the board until its full or a win took place. Depending on which player won, you yield -1 or 1.
Each recursion level always evaluates the values of the next recursion level (Deeper down) and takes the min/max of those values (Always max if going with negamax variant) and scores that branch with that min/max value.
the uppermost recursion level therefore gets the final evaluation and gets to evaluate which stone actually should be set.
@sharkantropo
sharkantropo
@sharkantropo
@alpox I see. My code stores the uppermost set of boards instead and performs recursion to set the proper min/max value for each board. I picked 10 to tell how deep it went before reaching a victory/loss state.
alpox
@alpox
@sharkantropo Hmm i see. While this could work, it makes it a bit complicated as you maybe see :D But I guess its a good try :+1:
I used an additional recursion parameter deep which i just increased in each recursive call so i always know on what level i am.
Also, i used only 1 copy of the board to produce the min/max. The min/max value is the return value of the recursion call. So there is no need to store it, because you just pass it
Now you can try to make it work your way if you want, but as you see, help is rare that way :D
If you're positive about managing on your own with your way, go with it
alpox
@alpox
@sharkantropo Quite obvious, but i want to point it out, is that this algorithm is not really on the level of FCC newcomers which just reach the tic-tac-toe project, even though its a really good / hard challenge :) so you're sure doing great!
Lots of people don't go so far to even try
sharkantropo
@sharkantropo
@alpox Na, I made it this way because since I felt FCC encourages to figure things out by your own. This is what I came up with after reading some minmax theory, but I would gladly switch if that means to make something more simple and effective, unless that implies I have to start from scratch D: . May I see an example of an implementation of that simpler solution?
alpox
@alpox
@sharkantropo I can show you mine if it helps your vision
The core algorithm may be quite understandable, just don't read the stuff all around, because there is a bit more complicated react/redux going on
sharkantropo
@sharkantropo
@alpox Alright then thanx for pointin' that out. I'll take a look.
CamperBot
@camperbot
sharkantropo sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
api offline
Yingjie (Iris) Hu
@huyingjie
I have a problem about scrollspy. I have been worked on this problem for several hours. Could anyone look at it? Thank you. https://forum.freecodecamp.org/t/scroll-spy-not-working-with-bootstrap-4/162768
Hammad
@newnewb
can anyone help me with running react on codepen?
Hammad
@newnewb
solved
Stephen James
@sjames1958gm
@newnewb :+1:
Ken Haduch
@khaduch
@huyingjie - the first problem is that in your javascript code, you have identified the wrong target. Changing it to $('body').scrollspy({ target: '.navbar' }) - using .navbar as the target, gets it going in the right direction. The first link for "ABOUT" is remaining highlighted, though, so there is another problem. Still investigating that.
Yingjie (Iris) Hu
@huyingjie
@khaduch Thank you. It is correct now. $('body').scrollspy({ target: '#navbar-example' }) is useless. The page can run without this code.
CamperBot
@camperbot
huyingjie sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3571 | @khaduch |http://www.freecodecamp.org/khaduch
Ken Haduch
@khaduch
@huyingjie - I think that you just want to remove the class active from the "ABOUT" link - it will be highlighted as you start to scroll the page.
Yingjie (Iris) Hu
@huyingjie
@khaduch Thank you. I deleted it.
CamperBot
@camperbot
huyingjie sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
api offline
Ken Haduch
@khaduch
@huyingjie - you're welcome
Terence Mangram
@terensu-desu
Anyone able to help me figure out enabling CORS for my ajax call? I don't really understand how to do it, but I understand what it does. I just need some clarity on why I keep getting Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. when I thought I had declared the correct header. I'm doing the FCC Wikipedia Viewer project.
https://codepen.io/terensu-desu/pen/jaoxrW
primuscovenant
@primuscovenant
@heroiczero thx
CamperBot
@camperbot
primuscovenant sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 2099 | @heroiczero |http://www.freecodecamp.org/heroiczero
Ken Haduch
@khaduch
@terensu-desu - did you try adding an origin=* parameter to your url? My memory is a little fuzzy but I think that Wikipedia allows that?
Terence Mangram
@terensu-desu
@khaduch Thanks for the suggestion, but that didn't work out for me.
CamperBot
@camperbot
terensu-desu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3572 | @khaduch |http://www.freecodecamp.org/khaduch
i did a writeup on this project a few months ago. part of it talks about this error message and how to fix it