1
\$\begingroup\$

Sorry if this is the wrong place to do this.

Following this question Is it acceptable to ask for Github Pull Requests for a King of the Hill challenge? I need a sandbox to try out the StackOverflow API for grabbing code from answers.

Please do not post answers to this question.

I may delete it early on, once the concept is proven.

\$\endgroup\$
  • \$\begingroup\$ I'm here to add a comment to help you ensure that your code works even with comments posted \$\endgroup\$ – Mathgeek Mar 4 at 14:50
  • \$\begingroup\$ Thanks @Mathgeek. It shouldn't matter too much because I'm filtering out the comments, but it can't hurt to have a little noise here. \$\endgroup\$ – AJFaraday Mar 4 at 14:51
  • \$\begingroup\$ I tried a similar thing once and it caught comments instead of the answer once there were enough, so I figured an extra lob wouldn't hurt. \$\endgroup\$ – Mathgeek Mar 4 at 14:54
  • \$\begingroup\$ I am also here just to make it a bit harder for no obvious reason ... \$\endgroup\$ – Veljko89 Mar 5 at 14:45
  • \$\begingroup\$ If anyone's interested, the comments did not cause any problems with my importing process. \$\endgroup\$ – AJFaraday Mar 5 at 15:42
  • \$\begingroup\$ Then one with a code block: f=_=>{throw 'AJFaraday';} :) \$\endgroup\$ – Bubbler Mar 6 at 8:26
  • \$\begingroup\$ @Bubbler You make a good point. I'm working on a fairly-paranoid importer script which should throw out answers which risk messing up the competition environment. \$\endgroup\$ – AJFaraday Mar 6 at 9:21
  • \$\begingroup\$ "Please ignore this question" tends to attract attention. Perhaps try "Stack Exchange API sandbox"? You can also go ahead and remove the first sentence. This is the perfect place to do this. \$\endgroup\$ – S.S. Anne Mar 10 at 22:30
3
\$\begingroup\$

Imported

Behaviours.Imported = class Imported extends Behaviour {

  constructor(snake) {
    super(snake);
    this.spot = {
      x: (Math.random() * this.game_width()),
      y: (Math.random() * this.game_height())
    };
  }

  name() {
    return 'Imported';
  }

  colour() {
    return 'rgba(0,255,255,0.4)';
  }

  set_target() {
    this.target(this.spot);
    //this.target(this.food()[0])
  }

  idle() {
    this.target(this.spot);
  }

};
\$\endgroup\$
  • \$\begingroup\$ Care to add a Try It Online? \$\endgroup\$ – petStorm Mar 6 at 1:00
  • \$\begingroup\$ I could, although it would prove very little. Just that Behaviours is undefined. \$\endgroup\$ – AJFaraday Mar 6 at 9:18
2
\$\begingroup\$

Invalid

Behaviours.Invalid = class Invalid extends Behaviour {

  constructor(snake) {
    super(snake);
  }

  name() {
    return 'Invalid Invalid Invalid Invalid Invalid Invalid Invalid ';
  }

  colour() {
    return 'rgba(0,999,255,0.1)';
  }

  set_target() {
    this.target(this.food()[0]);
  }

  idle() {
    console.log('idling');
  }

};
\$\endgroup\$
2
\$\begingroup\$

MoreJunk

throw 'ha ha haaa!';
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .