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
alpox
@alpox
@Pendramon Have fun trying to beat mine :D
Pendramon
@Pendramon
Dude if it goes first no way to beat it in clever mode
Radek
@radekjohn
@alpox first it tryes to occupy central square. than it tryes to make row of its own two squares. than it is looking for row of two to win. if there is no such row, it is looking for such row owned by enemy to prevent him from winning. thats all
minimax is unbeatable by definition
alpox
@alpox
@radekjohn yea minimax is pretty badass
No way to beat
I used it in my tictactoe
Radek
@radekjohn
@alpox i will try to implement it next time
Pendramon
@Pendramon
minimax is just block the middle for computer not to win xd
alpox
@alpox
@Pendramon Nope :D
Pendramon
@Pendramon
unless it goes first and puts middle then just put next to it and continue placing where he will win xd
Cato Myhre
@Zalmez
can anyone help me with the spyscroll?
Radek
@radekjohn
i have somewhere a funciton which blocks the board, but i do not remember its name :-)
Cato Myhre
@Zalmez
can't get it to work q.q
alpox
@alpox
@Pendramon My minimax doesn't even put it in the middle in the first iteration :D
Pendramon
@Pendramon
or not nvm
It does if you reset it a couple of times
Cato Myhre
@Zalmez
I have just used some place holder text for now, far from done. just want some of the basic looks to be there
alpox
@alpox
Minimax is sometimes funny that it prefers a guaranteed win over a direct win
Pendramon
@Pendramon
Oh yea just noticed that xd
rfvergeldedios
@rfvergeldedios
Hi, may I ask for advice please? I don't understand why getJSON only picks up the last item of my array despite the variable used changes value at the start of the for-loop (getJSON at line 24 ). https://codepen.io/RafaelVD/pen/MogWRv?editors=0010
alpox
@alpox
@Zalmez You have to add jQuery before adding the javascript for bootstrap v4 otherwise it doesn't work
Pendramon
@Pendramon
okay i give up you cant win over minimax xd
alpox
@alpox
:D nop
Pendramon
@Pendramon
its just draw after draw
alpox
@alpox
@rfvergeldedios i doesn't change anymore when the callback runs - it already arrived at the last item
@rfvergeldedios Use let i instead of var i in the for loop
h1tag
@h1tag
@alpox also the for loop doesn't wait for getJSON to get the results, right?
Radek
@radekjohn
OK, i am donne. the board is off until the player chooses everything
alpox
@alpox
@h1tag One moment i'm looking. Still something off :D might be true
@h1tag But yea the for loop doesn't wait
This shouldn't matter though if you use let
Aaha
Its because of the other variables
var chnUser = 'https://wind-bow.glitch.me/twitch-api/users/'+channels[a];    
var userName = chnUser.substring(44, chnUser.length);;
It works if these both are defined with let
let chnUser = 'https://wind-bow.glitch.me/twitch-api/users/'+channels[a];    
let userName = chnUser.substring(44, chnUser.length);;
h1tag
@h1tag

@alpox

This shouldn't matter though if you use let

why?

Faisal
@Faisa1khan
image.png
alpox
@alpox
@h1tag it matters when you use var to define a variable - because a variable declared with var is defined in full function scope - if you change it in another iteration, the value will have changed in the whole function (Also for the last iteration)
If you use let, the variable will be block scoped - means that it will preserve its state and will only be defined in its own block of code. This makes it possible that the variable stays the same if you do an asynchronous request and use the variable in the same block
Its bit hard to understand for new people here, but i usually tell to use let instead of var for that they don't have to rewrite the whole loop stuff :-)
@rfvergeldedios :point_up: 1. Juni 2017 11:23
Cato Myhre
@Zalmez
@alpox wut, explain a little more.
Faisal
@Faisa1khan
plzzz help why the navbar ain't align properly https://codepen.io/Hackplacea/pen/BZBBxO?editors=1000#0
Cato Myhre
@Zalmez
like how?
alpox
@alpox
@Zalmez You mean the jquery thing?
Cato Myhre
@Zalmez
yeah
alpox
@alpox
@Zalmez In the settings -> javascript