Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:09
    thecodingaviator commented #31179
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:07
    thecodingaviator commented #31182
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator commented #31190
  • Apr 01 18:05
    thecodingaviator commented #31157
  • Apr 01 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
  • Apr 01 18:02
    thecodingaviator commented #31059
Adel
@AdelMahjoub
@piteto and better perf than setInterval
juni
@junipberry
hi guys, I’m trying to give the properties of obj2 to obj1. Is this the right way about it?
function extend(obj1, obj2) {
  if (obj1[key]===true){
  return obj1 === obj2[key];
}
}
Coy Sanders
@coymeetsworld
@junipberry key isn't defined, you should look into the Object.keys and hasOwnProperty functions
Randell Dawson
@RandellDawson
@junipberry - question - what do you think your if statement is evaluating?
Caleb Cox
@CalebCox
Hello everyone! I'm working on the Tic Tac Toe advanced project and I'm having some issues understanding how to properly implement minimax or similar algorithms to create an unbeatable AI for a board that's in a 2D array. Does anyone have any resources that would be helpful or any suggestions?
juni
@junipberry
good point, ty @coymeetsworld. Fixing it now.
CamperBot
@camperbot
junipberry sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
api offline
Randell Dawson
@RandellDawson
@CalebCox - why not attempt your own algorithm?
Coy Sanders
@coymeetsworld
This helped for me @camperbot https://www.youtube.com/watch?v=J1GoI5WHBto
but, you dont need to implement minimax, making the game unbeatable was removed as a req over a year ago
Caleb Cox
@CalebCox
@coymeetsworld thank you! I also didn't notice it wasn't a requirement any longer, the video still mentioned it but the side panel's user stories do not lol.
Coy Sanders
@coymeetsworld
yw @junipberry
CamperBot
@camperbot
calebcox sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
api offline
Randell Dawson
@RandellDawson
@CalebCox - This wiki gives some basic logic for AI.
Coy Sanders
@coymeetsworld
you should try to make the game first, then try to make it unbeatable @CalebCox , it was fun learning how it worked (also tough)
Caleb Cox
@CalebCox
@rmdawson71 thanks for the link, i'll reference that as well!
CamperBot
@camperbot
calebcox sends brownie points to @rmdawson71 :sparkles: :thumbsup: :sparkles:
api offline
Gersho
@Gersho
@CalebCox have you considered writing down how you would play to be unbeatable(as a set of rules to follow), and then translate that to code ?
such as: "if i'm O, and there's a line with 2 X" -> "i should interfere with that"
Caleb Cox
@CalebCox
@Gersho actually that never crossed my mind as an idea to try. I'll write out some test cases and see what works! Thanks for the suggestion
CamperBot
@camperbot
api offline
calebcox sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
Long Nguyen
@longnt80
@CalebCox if you try that way, here's the strategy written down: https://www.quora.com/Is-there-a-way-to-never-lose-at-Tic-Tac-Toe
@CalebCox btw, in case you didn't know, unbeatable is not a requirement for that project
Gersho
@Gersho
i actually had made that on mine and ended up removing it and making it random, tictactoe is supposed to be a children's game after all
piteto
@piteto
@AdelMahjoub Your code reminds me how much I need to learn canvas :)
Adel
@AdelMahjoub
Still not sure of the rotation direction https://jsbin.com/wawijobohe/edit?js,output
@intcreate if you don't like the image above, you can search for a better tiles sheet
Fernando
@lestairon
Oh my
Gersho
@Gersho
@lestairon what part ? if a challenge seems hard, try to separate it in smaller chunks to see what part is giving you trouble
Fernando
@lestairon
I don't know how to do a share button and where should i take the random quotes
I'll try to do it
Wish me luck
Claudio Restifo
@Marmiz
@lestairon For starter you don't need to pull the quotes from an API, you can simply create an Array of quotes and then pull out one at random.
After that simply switch from picking it one up from local to an API :)
Fernando
@lestairon
I'd like to do it using an API
To know how it works
Bryan Reese
@breese8009
heyyy whats this ~~ mean in JS?
Fernando
@lestairon
Uh, @Marmiz Can i create an API using google sheets?
Wait, maybe i don't know exactly how that works, but i saw a video doing that but with Python
Fernando
@lestairon
Nvm, that's not an API
It's a Database
Claudio Restifo
@Marmiz
@lestairon yep :)
An API is different... you can create one for sure :)
How good are you at back end?
silver537
@silver537
You use the same technique on the database as if you would using an api
Claudio Restifo
@Marmiz
@breese8009 ~ is a negative bitwise operation in JS... so I assume ~~ is a double bitwise so maybe a double negative operation?
I guess it just remove the decimals at this point.... kinda like Math.floor()... but not sure at all.
Never saw it nor used it
rafaelmonroy
@rafaelmonroy

@rafaelmonroy
hey guys what value can I set my data.stream equal so that my else if statement returns my desired info?

$(function(){
  var users = ["ESL_SC2", "freecodecamp", "noobs2ninjas", "realisticgamingyoutube"];
  var i = 0;
  while (i<users.length){
   $.ajax({
    type: 'GET',
    url: 'https://wind-bow.glitch.me/twitch-api/streams/'+users[i]+'/',
    success: function(data) {
      if (data.stream === null){
        console.log('offline')
        } else if (data.stream === true){
        console.log(data.stream.game + ', '+data.stream.stream_type)
        }     
      }
    })
    i++
  } 
});

it works when I remove the else if statement and just leave as an else statement, but am curious to know what value i can enter with an else if statement