Author Topic: Commands for Axe  (Read 44346 times)

0 Members and 3 Guests are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Commands for Axe
« Reply #60 on: June 16, 2011, 01:14:43 pm »
Axe can't handle negative numbers.
I'm not a nerd but I pretend:

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Commands for Axe
« Reply #61 on: June 16, 2011, 01:19:43 pm »
Yes it can. You have to use different commands for division and greater-than/less-than comparisons, but it works correctly with addition, subtraction, and multiplication.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Commands for Axe
« Reply #62 on: June 16, 2011, 01:20:23 pm »
Did you try the solution of my previous post to replace the negative Q ?

@calc84maniac we can do -3→Q ?
« Last Edit: June 17, 2011, 12:38:45 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Commands for Axe
« Reply #63 on: June 16, 2011, 01:23:48 pm »
and I mustn't use a -3 ???
what's about 10-3 ???
It would be positive

Hayleia:
   trying it right now.
« Last Edit: June 16, 2011, 02:32:33 pm by p2 »
*insert supercool signature*

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Commands for Axe
« Reply #64 on: June 16, 2011, 01:25:55 pm »
Oooooh that makes a wave !!!
Nevermind, did you try the solution of my previous post to replace the negative Q ?

@calc84maniac we can do -3→Q ?
Yes. Technically how signed numbers work is that the range of values 32768 to 65535 are considered to be -32768 to -1. So when you store -3 to Q, you're storing the unsigned value 65533. When you add or subtract that with another number, it acts like -3 (due to the limited range of 16-bit numbers)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Commands for Axe
« Reply #65 on: June 16, 2011, 01:28:01 pm »
ok, so it turns around, in fact
0,1,2,3,4,...,65533,65534,65535,0,1,2,3,...
                    ↑ unsigned -3
Is that it ?
« Last Edit: June 16, 2011, 01:31:16 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Commands for Axe
« Reply #66 on: June 16, 2011, 01:29:52 pm »
You can use a negative 3.  Signed $-3 is equal to unsigned $FFFD.  Text( only displays unsigned variables.  
You can use addition and subtraction with signed integers.  For division and multiplication, you must use ** or // respectively.  For comparisons and division, you use doubled operators.  
With this knowledge, you can write a routine that can display signed variables.

EDIT Double Ninja'd (I take way to long to write a post.)
« Last Edit: June 16, 2011, 01:36:37 pm by ralphdspam »
ld a, 0
ld a, a

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Commands for Axe
« Reply #67 on: June 16, 2011, 01:30:18 pm »
ok, so it turns around, in fact
0,1,2,3,4,...,65533,65534,65535,0,1,2,3,...
                    ↑ -3
Is that it ?
Exactly. For more information on this number system, check out http://en.wikipedia.org/wiki/Two%27s_complement
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Ashbad

  • Guest
Re: Commands for Axe
« Reply #68 on: June 16, 2011, 01:31:32 pm »
Yes, that's how it works.  When doing multiplication and division, like calc84 said, though, you need to be aware you're using signed values.  Also, when using one negative number and adding it to a positive number to actually subtract it, be sure you use equal-bit-length numbers, since if A = 5 and {L1} = -3, A+{L1} doesn't yield 2, it gives 257 since {L1} is only 8 bits and you're doing 16 bit math.

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Commands for Axe
« Reply #69 on: June 16, 2011, 01:31:42 pm »
Cool!  :D  :D  :D
Hyroglyphs!

others than before.

These are looking better than the ones before.

 :D
*insert supercool signature*

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Commands for Axe
« Reply #70 on: June 16, 2011, 01:31:48 pm »
You can use a negative 3.  Signed $-3 is equal to unsigned $FFFD.  Text( only displays unsigned variables. 
You can use addition and subtraction with signed integers.  For division and multiplication, you must use ** or // respectively.  For comparisons, you also use doubled operators. 
With this knowledge, you can write a routine that can display signed variables.
Actually, you must use the normal multiplication (it works because it's so closely related to addition/subtraction). In Axe, ** is something different entirely called fixed-point multiplication.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Commands for Axe
« Reply #71 on: June 16, 2011, 01:45:48 pm »
What can I do else?
Hayleias Idea hasn't made it.
 Any ideas?
*insert supercool signature*

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Commands for Axe
« Reply #72 on: June 16, 2011, 02:00:06 pm »
ugh... Rewrite everything. Try this one, and tell the others if it worked. I'm going to sleep.  :)
Had to put it in code Quote to put colors

Quote
:.FORCEATT
:Fix 5
:ClrDraw
:DispGraph
:Circle(15,15,10
:Circle(80,15,10
:Text(57,10,("DEF")
:Text(57,75,("OFF")

:Text(10,57,"DEF
:Text(75,57,"OFF

:Line(25,15,30,10
:Line(70,15,65,10
:Line(30,10,45,10
:Line(65,10,50,10
:Line(45,10,47,8
:Line(50,10,48,8
:Line(30,7,65,7
:Line(30,7,28,0
:Line(65,7,67,0
:Line(5,15,0,10
:Line(90,15,95,10
:DispGraph
:rand^1+101→F
:For(U,1,F
:If U≥0 and (U≤9)
:-3→Q
:0→Q
:End
:If U>99
:3→Q
:6→Q
:End
:If U≥10 and (U≤99)
:0→Q
:3→Q
:End
:Fix 1
:Text(44,10-Q,U▶Dec
:Text(10-3-Q,44,U▶Dec
:DispGraph
:Fix 0
:End
:rand^1+101→N
:For(U,1,N
:If U≥0 and (U≤9)
:-3→Q
0→Q
:End
:If U>99
:3→Q
:6→Q
:End
:If U≥10 and (U≤99)
:0→Q
:3→Q
:End
:Fix 1
:Text(44,75-Q,U▶Dec
:Text(75-3-Q,44,U▶Dec
:DispGraph
:Fix 0
:End
:Line(36,60,58,60
:Pt-On(35,62
:Pt-On(35,61
:Pt-On(59,62
:Pt-On(59,61

:Pxl-On(35,62
:Pxl-On(35,61
:Pxl-On(59,62
:Pxl-On(59,61

:Line(89,29,89,61
:Line(89,29,93,29
:Line(94,29,94,61
:Line(89,61,4,61
:Line(91,U,92,U
:DispGraph
:Pause 5000
:Fix 4
« Last Edit: June 17, 2011, 07:54:19 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline p2

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 849
  • Rating: +51/-11
  • I'm back :)
    • View Profile
Re: Commands for Axe
« Reply #73 on: June 17, 2011, 05:02:05 am »
Loaded Axe Parser 0.5.3 on my TI.
mADE EVERYTHING WHAT hAYLEIA TOLD ME TO DO:
CREATING APP:

since 5 minutes it's Defragmenting...    :P



restartet it
APP is ready


Quote
of Hayleia:

:Pt-On(35,62
:Pt-On(35,61
:Pt-On(59,62
:Pt-On(59,61
:Pxl-On(35,62
:Pxl-On(35,61
:Pxl-On(59,62
:Pxl-On(59,61
To change between pxl and Point:
Pkt-On(A,B) = Pxl-On(iPart(abs(B-63)),iPart(A))
but in this PRGM it must be Pxl-On(abs(B-63),A)
So it will be:
Pxl-On(0,35)
Pxl-On(1,35)
Pxl-On(0,59)
Pxl-On(1,59)





It's the same picture of hyroglyphes again.
I've made a picture of it:
« Last Edit: June 17, 2011, 06:56:13 am by p2 »
*insert supercool signature*

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Commands for Axe
« Reply #74 on: June 17, 2011, 06:47:58 am »
Betrag-63? o.o what is that scary command?
I'm not a nerd but I pretend: