Author Topic: Need help with a bug  (Read 3308 times)

0 Members and 1 Guest are viewing this topic.

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Need help with a bug
« on: July 20, 2011, 10:20:41 am »
I've been learning Axe yesterday while I was on a car trip and I decided to practice by making a small sprite editor. It works fine except that it won't draw and it's reading incorrectly. I think the problem is with the list I use but I'm not sure.

Code: [Select]
.SPRITE

[FF818181818181FF0000000000000000]->Pic1
[3C7EFFFFFFFF7EC30000000000000000]->Pic2
DiagnosticOff
0->{L4}
Fill(L4, 63)
0->X->Y
Repeat geyKey(15)
For(A, 0, 7)
For(B, 0, 7)
{L4+A*8+B}
If Ans
Rect(A*8, B*8, 8, 8)
End
End
End
{L4+X+Y*8}
If Ans
Pt-On(X, Y, Pic2)
Else
Pt-On(X, Y, Pic1)
End
If getKey(2)
If X!=0
X-8->X
End
End
If getKey(3)
If X!=56
X+8->X
End
End
If getKey(4)
If Y!=0
Y-8->Y
End
End
If getKey(1)
If Y!=56
Y+8->Y
End
End
If getKey(54)
{L4+X+Y*8}
If Ans
0->{L4+X+Y*8}
Else
1->{L4+X+Y*8}
End
End
DispGraphClrDraw
End

You guys can probably find >9000 optimizations but what is happening is that, it displays the cursor fine. The cursor works. But when you press 2nd nothing happens. And it doesn't read correctly overall. Also, do I need to use r for {L4+X+Y*8}? As in {L4+X+Y*8}r

Thanks :D

Btw, Axe really is great!  ;D

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

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: Need help with a bug
« Reply #1 on: July 20, 2011, 10:26:45 am »
I think Fill needs to be Zeroes, and are you actually putting a pixel for every 1 in L4?

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 Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Need help with a bug
« Reply #2 on: July 20, 2011, 10:40:07 am »
yes, eventually I'll make an equation that parses through it, and makes the Hex for the sprite and save it to Str1 (course there's probably a MUCH better way to do it that I don't know about :P). But I want it to actually draw first. D:

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...

Ashbad

  • Guest
Re: Need help with a bug
« Reply #3 on: July 20, 2011, 12:04:45 pm »
Well, a few problems.  You must remember that Axe doesn't follow the standard order of operations in mathematica.  So, you're accessing the place of {(L4+x+y)*8}, not {y*8+x+L4} because axe uses left to Right operation order.

Also, why the use of Ans?  Ans in Axe is pretty much useless.  HL is what you use instead of Ans, but it can't be accessed directly.  So put If expression instead of expression:If Ans.

Offline Scipi

  • Omni Kitten Meow~ =^ω^=
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1547
  • Rating: +192/-3
  • Meow :3
    • View Profile
    • ScipiSoftware
Re: Need help with a bug
« Reply #4 on: July 20, 2011, 08:27:05 pm »
Thanks, I will update that now. I didn't know about the left to right operations or the Ans.

Imma Cat! =^_^= :3 (It's an emoticon now!)
Spoiler For Things I find interesting:
Spoiler For AI Programming:
Spoiler For Shameless advertising:

Spoiler For OldSig:





Spoiler For IMPORTANT NEWS!:
Late last night, Quebec was invaded by a group calling themselves, "Omnimaga". Not much is known about these mysterious people except that they all carried calculators of some kind and they all seemed to converge on one house in particular. Experts estimate that the combined power of their fabled calculators is greater than all the worlds super computers put together. The group seems to be holding out in the home of a certain DJ_O, who the Omnimagians claim to be their founder. Such power has put the world at a standstill with everyone waiting to see what the Omnimagians will do...

Wait... This just in, the Omnimagians have sent the UN a list of demands that must be met or else the world will be "submitted to the wrath of Netham45's Lobster Army". Such demands include >9001 crates of peanuts, sacrificial blue lobsters, and a wide assortment of cherry flavored items. With such computing power stored in the hands of such people, we can only hope these demands are met.

In the wake of these events, we can only ask, Why? Why do these people make these demands, what caused them to gather, and what are their future plans...