Author Topic: Axe game : Avoid  (Read 17336 times)

0 Members and 1 Guest are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe game : Avoid
« Reply #30 on: December 24, 2010, 06:19:37 am »
thank you mighty, now i know exactly how works linking.

For the optimizations, you save 5 or 6 bytes when doing this:
Code: [Select]
!If A-20
code...
End

instead of this:
Code: [Select]
If A=20
code...
End

Woah! I could never remember such thing, nice, it does make sense because if A is 20, A-20 will be 0, so !If...

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Axe game : Avoid
« Reply #31 on: December 24, 2010, 10:52:13 pm »
wow!  that's genius!
* yunhua98 goes to optimize...  :P

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Axe game : Avoid
« Reply #32 on: December 24, 2010, 10:54:03 pm »
thank you mighty, now i know exactly how works linking.

For the optimizations, you save 5 or 6 bytes when doing this:
Code: [Select]
!If A-20
code...
End

instead of this:
Code: [Select]
If A=20
code...
End

Woah! I could never remember such thing, nice, it does make sense because if A is 20, A-20 will be 0, so !If...
Actually, is it an optimization in size and speed?  That's actually really nice. Because if A is less than 20, then it will just wrap around too. Very nice!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe game : Avoid
« Reply #33 on: December 25, 2010, 01:13:06 am »
thank you mighty, now i know exactly how works linking.

For the optimizations, you save 5 or 6 bytes when doing this:
Code: [Select]
!If A-20
code...
End

instead of this:
Code: [Select]
If A=20
code...
End

Woah! I could never remember such thing, nice, it does make sense because if A is 20, A-20 will be 0, so !If...
Actually, is it an optimization in size and speed?  That's actually really nice. Because if A is less than 20, then it will just wrap around too. Very nice!

Yep, it's a really useful optimization, but it doesn't always work with negative numbers IIRC. Most of the time they never go negative anyway, though :D !If is awesome because it's exactly the same size as If .




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe game : Avoid
« Reply #34 on: December 25, 2010, 02:10:28 am »
Hmmm doesn't work for negative numbers?  Would't any number besides 20 give a non-zero result, and therefore not trigger the If statement?

EDIT: wow this optimization is incredible, is there any way to auto-detect this?
« Last Edit: December 25, 2010, 02:19:26 am by Builderboy »

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Axe game : Avoid
« Reply #35 on: December 25, 2010, 05:52:17 am »
Warning ! It works with only one test, you cannot do this for example
Code: [Select]
If A-20 and (B-20)
code...
End

« Last Edit: December 25, 2010, 05:52:34 am by Fast Crash »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe game : Avoid
« Reply #36 on: December 25, 2010, 06:26:51 am »
It does actually, you just have to be careful and use De Morgan's laws:

Code: [Select]
:If A=1 and (B=2)

To this:

:!If A-1 [16bit or] (B-2)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Axe game : Avoid
« Reply #37 on: December 25, 2010, 06:32:10 am »
Ahh ok.Nice   :D

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axe game : Avoid
« Reply #38 on: December 25, 2010, 11:21:44 am »
What saves more, this opt or the inData() trick? (assuming that the inData() routine already exists...and that there is only 1 comparison...iirc inData() with 1 comparison is like 12 or 13 bytes)

Also, nice game Fast Crash ;)
« Last Edit: December 25, 2010, 11:28:23 am by squidgetx »

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Axe game : Avoid
« Reply #39 on: December 25, 2010, 11:50:30 am »
Thank you ! Now i have to finish linked multiplayer. It will be a bit slower than on-calc multiplayer, but that'll be fun :) . I just need mighty moose to test the first playable version.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe game : Avoid
« Reply #40 on: December 25, 2010, 02:08:23 pm »
What saves more, this opt or the inData() trick? (assuming that the inData() routine already exists...and that there is only 1 comparison...iirc inData() with 1 comparison is like 12 or 13 bytes)

Also, nice game Fast Crash ;)

I think I made a post about this a while ago...

Ah yes, I did! Here it is. You have to remember that inData() only works with bytes though, not with words like normal equality checks.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axe game : Avoid
« Reply #41 on: December 25, 2010, 07:11:49 pm »
Thank you ! Now i have to finish linked multiplayer. It will be a bit slower than on-calc multiplayer, but that'll be fun :) . I just need mighty moose to test the first playable version.

i have 2 calcs at the ready if you want me to test.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Axe game : Avoid
« Reply #42 on: December 26, 2010, 11:25:36 am »
thank you but i found how to link 2 calcs on wabbit emu.
I just have a question: does the linking command use variables? or pointers? currently only constants work perfectly.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axe game : Avoid
« Reply #43 on: December 26, 2010, 11:29:07 am »
thank you but i found how to link 2 calcs on wabbit emu.
I just have a question: does the linking command use variables? or pointers? currently only constants work perfectly.


How? Please post how you linked 2 calcs using WabbitEmu

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Axe game : Avoid
« Reply #44 on: December 26, 2010, 11:31:50 am »
Run wabbit emu.
File -> New
Calculator -> Connect to...

And it should work :)