Discuss Scratch

IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

Let's Play: Figure Out How STINGER works without seeing it in person/seeing the code!



So what we know already:

- Really High Scorer
- It is protected well
- There is some spots in the code that is weak

What we can assume by that:

- Small Code or a lot of IF statements and SET EXECUTION_POINTERs or a mixture of both
- It has some method that protects it from getting TAGed most of the time without taking too much code/time

How can we (I mean I) make a bot to beat STINGER?

- A bot that is small so it can do more so it can get more points
- Creating a fully protected bot that does not take too much code/time

And yes I have a untested prototype that I am working on to do this you are welcome.

Edit: Please play along

Last edited by IcyCoder (July 14, 2016 13:10:09)


Because JS is the future (echos) future future futur futu fut fu f
IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

IcyFireBot coming soon:



I changed one thing and look at it now:


Still Working on beating Snipar!

Last edited by IcyCoder (July 14, 2016 13:27:16)


Because JS is the future (echos) future future futur futu fut fu f
goldfish678
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

2hax4me

Seriously though, I have no experience to do this kind of thing
MegaApuTurkUltra
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

I'll note that it's not really fair to show bots off and not actually submit the code. It's no fun when you don't know what weaknesses to exploit.

$(".box-head")[0].textContent = "committing AT crimes since $whenever"
MegaApuTurkUltra
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

goldfish678 wrote:

2hax4me

Seriously though, I have no experience to do this kind of thing
Just put something together quickly and try it

You never know how well a bot will actually do

$(".box-head")[0].textContent = "committing AT crimes since $whenever"
IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

MegaApuTurkUltra wrote:

I'll note that it's not really fair to show bots off and not actually submit the code. It's no fun when you don't know what weaknesses to exploit.
OK when I am done my testing/fixing I will release the code

Because JS is the future (echos) future future futur futu fut fu f
IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

Submission: IcyFireBot

PROTECT EXECUTION_POINTER
SET DIRECTION RANDOM
MOVE
PROTECT @RANDOM%7+1
SET *@RANDOM @6
TAG IcyFireBot
SET EXECUTION_POINTER 1

Credit: @jokebookservice1 for line 4

Because JS is the future (echos) future future futur futu fut fu f
TheMonsterOfTheDeep
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

IcyCoder wrote:

IcyFireBot coming soon:



I changed one thing and look at it now:


Still Working on beating Snipar!
Wow I didn't know Snipar could win in a giant brawl!

Right now its main weakness is that it doesn't protect EXECUTION_POINTER so a bot can write malicious code to its unprotected section and then set it's execution pointer to execute it. I'm going to fix this flaw at somepoint.

my latest extension: 2d vector math
CodeLegend
Scratcher
500+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

IcyCoder wrote:

Small Code
It uses all 32 lines.

IcyCoder wrote:

a lot of IF statements and SET EXECUTION_POINTERs or a mixture of both
2 IFs, 5 SET EXECUTION_POINTERs.

IcyCoder wrote:

It has some method that protects it from getting TAGed most of the time without taking too much code/time
15 PROTECTs

IcyCoder wrote:

How can we (I mean I) make a bot to beat STINGER?
YOU CAN'T. MUAHAHAHAHAHA
TheMonsterOfTheDeep
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

@MATU did you see the problem I'm having with the controller?

my latest extension: 2d vector math
CodeLegend
Scratcher
500+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

STINGER beat Snipar 1v1 119 to 1.

jokebookservice1 wrote:

Could you try:
PROTECT EXECUTION_POINTER
MOVE
IF *EXECUTION_POINTER EQUALS -1 1 4
SET *@RANDOM @8
PROTECT @(RANDOM%8+1)
PROTECT @RANDOM
SET EXECUTION_POINTER 1
TAG RunRunProtect

and have another go with the similar
PROTECT EXECUTION_POINTER
MOVE
IF *EXECUTION_POINTER EQUALS -1 1 4
SET *@RANDOM @8
PROTECT @(RANDOM%8+1)
SET @(RANDOM%24+9) @8
SET EXECUTION_POINTER 1
TAG RunRunProtect
Against the first, STINGER won 1v1 25 to 6.
Against the second, STINGER won 1v1 63 to 9.

With some other bots present (using the first quoted RunRunProtect):

Other than possibly SPAMela, I think Snipar has the best chances against STINGER, at least in group scenarios.
jokebookservice1
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

Well I think mine needs to do more protecting
And way more attacking
And a bit of changing direction
TheMonsterOfTheDeep
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

CodeLegend wrote:

STINGER beat Snipar 1v1 119 to 1.
I'm honestly not surprised.

my latest extension: 2d vector math
CodeLegend
Scratcher
500+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

TheMonsterOfTheDeep wrote:

CodeLegend wrote:

STINGER beat Snipar 1v1 119 to 1.
I'm honestly not surprised.
Well it's just not really made for a one-on-one… It has come very close to beating me, though. It's usually higher in points for the first 2000-3000 turns.
IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

Mine needs more protecting and more offense

Because JS is the future (echos) future future futur futu fut fu f
IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

@CodeLegend can you put STINGERs code up now

MegaApuTurkUltra wrote:

I'll note that it's not really fair to show bots off and not actually submit the code. It's no fun when you don't know what weaknesses to exploit.

Because JS is the future (echos) future future futur futu fut fu f
gtoal
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

META-suggestion for the next ATC (regardless of who sponsors it)

Can we
1) do it in Scratch?
and
2) do something whose solution is of long term benefit to the Scratch community?

For example (not a suggestion for the contest, just an example of the sort of thing I mean) solving TSP for max 300 points (cf https://scratch.mit.edu/projects/75405472/ ) - 300 chosen because it fits the clone limit.

There are lots of difficult problems that can find practical applications in games - N-body gravity, billiards, stuff for the NPR studio, …

G
IcyCoder
Scratcher
1000+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

gtoal wrote:

META-suggestion for the next ATC (regardless of who sponsors it)

Can we
1) do it in Scratch?
and
2) do something whose solution is of long term benefit to the Scratch community?

For example (not a suggestion for the contest, just an example of the sort of thing I mean) solving TSP for max 300 points (cf https://scratch.mit.edu/projects/75405472/ ) - 300 chosen because it fits the clone limit.

There are lots of difficult problems that can find practical applications in games - N-body gravity, billiards, stuff for the NPR studio, …

G
I agree

Because JS is the future (echos) future future futur futu fut fu f
CodeLegend
Scratcher
500+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

IcyCoder wrote:

@CodeLegend can you put STINGERs code up now

MegaApuTurkUltra wrote:

I'll note that it's not really fair to show bots off and not actually submit the code. It's no fun when you don't know what weaknesses to exploit.
Oh, alright… but only because you spelled it in all caps.

EDIT: Keep in mind that this is the original code. It wasn't designed to target any specific bot. Please don't specifically target mine.

Last edited by CodeLegend (July 14, 2016 19:35:36)

CodeLegend
Scratcher
500+ posts

[ATC#3] So you say you're a "hacker"? Prove it!

Submission: STINGER
PROTECT @32
PROTECT @31
PROTECT EXECUTION_POINTER
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
SET DIRECTION RANDOM
MOVE
SET DIRECTION RANDOM
MOVE
SET *@*EXECUTION_POINTER @31
SET *@*EXECUTION_POINTER @31
IF *DIRECTION EQUALS -1 28 24
SET EXECUTION_POINTER 24
SET DATA1 1
SET *@DATA1 @32
SET DATA1 DATA1+1
IF DATA1 GREATERTHAN 32 28 30
SET EXECUTION_POINTER 1
SET EXECUTION_POINTER 1
SET EXECUTION_POINTER 25
SET EXECUTION_POINTER EXECUTION_POINTER-1
TAG STINGER

Revision 1
PROTECT @32
PROTECT @31
PROTECT EXECUTION_POINTER
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
MOVE
SET DIRECTION RANDOM
MOVE
SET DIRECTION RANDOM
SET *EXECUTION_POINTER RANDOM
SET *@*EXECUTION_POINTER @31
SET *@*EXECUTION_POINTER @31
IF *DIRECTION EQUALS -1 28 24
SET EXECUTION_POINTER 24
SET DATA1 1
SET *@DATA1 @32
SET DATA1 DATA1+1
IF DATA1 GREATERTHAN 32 28 30
SET EXECUTION_POINTER 1
SET EXECUTION_POINTER 1
SET EXECUTION_POINTER 25
SET EXECUTION_POINTER EXECUTION_POINTER-1
TAG STINGER

Revision 2
PROTECT @32
PROTECT @31
PROTECT EXECUTION_POINTER
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM%10+21
PROTECT @RANDOM%10+21
PROTECT @RANDOM
PROTECT @RANDOM
PROTECT @RANDOM%10+21
PROTECT @RANDOM%10+21
PROTECT @RANDOM
PROTECT @RANDOM
MOVE
SET DIRECTION RANDOM
MOVE
SET DIRECTION RANDOM
SET *EXECUTION_POINTER RANDOM
SET *@*EXECUTION_POINTER @31
SET *@*EXECUTION_POINTER @31
IF *DIRECTION EQUALS -1 28 23
SET EXECUTION_POINTER 24
SET DATA1 1
SET *@DATA1 @32
SET DATA1 DATA1+1
IF DATA1 GREATERTHAN 32 28 30
SET EXECUTION_POINTER 1
SET EXECUTION_POINTER 1
SET EXECUTION_POINTER 25
SET EXECUTION_POINTER EXECUTION_POINTER-1
TAG STINGER

Last edited by CodeLegend (July 14, 2016 20:32:57)

Powered by DjangoBB