Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Broseph Radson on January 21, 2011, 09:39:13 am

Title: For those of us who dont know binary...
Post by: Broseph Radson on January 21, 2011, 09:39:13 am
Hope this makes graphics easier  ;D
Title: Re: For those of us who dont know binary...
Post by: JustCause on January 21, 2011, 09:47:52 am
THANK YOUUUUUUUUUUUUU

:w00t:
Title: Re: For those of us who dont know binary...
Post by: Binder News on January 21, 2011, 09:58:43 am
Very nice.
As a side note:
Code: [Select]
0->B->C->D
For(A,0,15)
Pt-Off(0,A,{o}A)
End
DispGraph
Should give the same thing. (except for the randomness of whatever is in B, C, and D)
{o}=o
Title: Re: For those of us who dont know binary...
Post by: Deep Toaster on January 21, 2011, 10:51:19 am
Very nice.
As a side note:
Code: [Select]
For(A,0,15)
Pt-Off(0,A,{o}A)
End
DispGraph
Should give the same thing. (except for the randomness of whatever is in B, C, and D)
{o}=o

Brilliant, that's amazing!
Title: Re: For those of us who dont know binary...
Post by: Binder News on January 21, 2011, 01:48:32 pm
 ;D Thanks!
Modified the code to prevent any randomness showing up at the end.
Title: Re: For those of us who dont know binary...
Post by: Ashbad on January 21, 2011, 01:50:47 pm
I already memorized a while ago ;)

No need of using hexpic for b&w sprites anymore for me!
Title: Re: For those of us who dont know binary...
Post by: Eeems on January 21, 2011, 03:23:34 pm
Erm, shouldn't this be titled "For those of use who don't know Hexadecimal"?
Title: Re: For those of us who dont know binary...
Post by: AngelFish on January 21, 2011, 03:25:44 pm
That sprite appears somewhere in every single one of my programs...
Title: Re: For those of us who dont know binary...
Post by: Munchor on January 21, 2011, 03:30:19 pm
I already knew binary, hex, spriting by hand but this looks like a fairly good explanation ;D
Title: Re: For those of us who dont know binary...
Post by: Broseph Radson on January 21, 2011, 03:57:51 pm
They are hex numbars yes but the pixels are arranged in binary.
Title: Re: For those of us who dont know binary...
Post by: ztrumpet on January 21, 2011, 04:05:36 pm
There are 10 types of people in this world - Those who know binary and those who don't. ;D

Thanks Broseph. :)
Title: Re: For those of us who dont know binary...
Post by: Ashbad on January 21, 2011, 04:05:46 pm
just in case you ever forget what binary is use this extensive and beautiful list for reference; sorry for the long length but you have to admit it is complete
Title: Re: For those of us who dont know binary...
Post by: Broseph Radson on January 21, 2011, 04:06:59 pm
lol ztrumpet. i saw that on a bumper sticker once
Title: Re: For those of us who dont know binary...
Post by: Munchor on January 21, 2011, 04:07:48 pm
just in case you ever forget what binary is use this extensive and beautiful list for reference; sorry for the long length but you have to admit it is complete


WOW, I would have never found out about that, it's just wow, thanks much!
Title: Re: For those of us who dont know binary...
Post by: Ashbad on January 21, 2011, 04:08:11 pm
I've almost memorized it already
Title: Re: For those of us who dont know binary...
Post by: Munchor on January 21, 2011, 04:09:03 pm
I've almost memorized it already

I'm gonna print that so I can remember it all the time, I don't feel like memorizing it.
Title: Re: For those of us who dont know binary...
Post by: Ashbad on January 21, 2011, 04:09:29 pm
I've almost memorized it already

I'm gonna print that so I can remember it all the time, I don't feel like memorizing it.

^++
Title: Re: For those of us who dont know binary...
Post by: z80man on January 21, 2011, 05:45:08 pm
If you don't know binary there is no reason why you can't learn now.
Lets start by reviewing the number system you're probaly used to, the decimal system. It is called the decimal system because there are ten digits. 0 1 2 3 4 5 6 7 8 9. Now you probaly write zero as 0 but for the time being lets call it 0000. ( this will help you with binary later) If you increment 0000 by 1 you get 0001. Now if you do this eight more times you will have 0009. Now we are going to call the digit on the far right the zero's place, the second to right the one's place and so on. The dilema you now face is that there is no digit above 9. (No 10 is not a digit!) So what you can do now is increment the digit to the left of nine to one and you reset the 9 back to zero. 0010. Hey look you got the number 10  ;D. Okay so you're probaly thinking I already know this, but to learn binary you need to go back to the basics and learn the fundamentals of all number systems.

Now lets start learning binary. It is called binary because there are two digits 0 and 1. So lets start at zero. You write zero in binary as 0000. Look it is the same thing in decimal. Binary is easy. And if you increment that. Yep you guessed right 0001 is the number one. Now we face an issue. We are all out of digits. So what do we do? We reset the furthest right digit and increment the one to its left. So you get 0010. Now this looks like the number ten but it is really two. Now if we keep on following thsi we get 0011 0100 0101 0110 0111 1000 ans so on. In binary we call each digit a bit. and 8 bits make a byte. In one unsigned (not negative) byte you can write numbers from 0 to 255. Hope you now know binary  :hyper:

Pop quiz:
1001 =
0011 + 0100 =
1100 - 0101 =
Spoiler For Answers:
9
7
7
Title: Re: For those of us who dont know binary...
Post by: Builderboy on January 22, 2011, 03:04:13 am
Very nice.
As a side note:
Code: [Select]
0->B->C->D
For(A,0,15)
Pt-Off(0,A,{o}A)
End
DispGraph
Should give the same thing. (except for the randomness of whatever is in B, C, and D)
{o}=o

That is an amazingly neat piece of code!  I think

Code: [Select]
For(F,0,15
F->{F*12+L6}
End

might be smaller though ;)
Title: Re: For those of us who dont know binary...
Post by: calc84maniac on January 22, 2011, 09:38:36 am
Don't forget to "last answer" optimize :D
Code: [Select]
For(F,0,15
F->{*12+L6}
End
Title: Re: For those of us who dont know binary...
Post by: Binder News on January 22, 2011, 09:56:14 am
O.O Holy...
Yeah, that's a lot more optimized. Thanks!
Code: [Select]
ClrDraw
For(F,0,15
F->{*12+L6}
End
DispGraph
Title: Re: For those of us who dont know binary...
Post by: Builderboy on January 22, 2011, 03:03:40 pm
Don't forget to "last answer" optimize :D
Code: [Select]
For(F,0,15
F->{*12+L6}
End

Bah, I  never remember the tricky optimizations :P
Title: Re: For those of us who dont know binary...
Post by: nemo on January 22, 2011, 06:44:35 pm
Code: [Select]
0->F
While -16
F->{*12+L6}
F+1->F
End
can't hurt to save a byte

Title: Re: For those of us who dont know binary...
Post by: Binder News on January 22, 2011, 08:14:22 pm
Code: [Select]
0->F
While -16
F->{*12+L6}
F+1->F
End
can't hurt to save a byte
OMG. That's insane!
I should just write it in ASM and post the hex.
Title: Re: For those of us who dont know binary...
Post by: nemo on January 22, 2011, 08:27:59 pm
Code: [Select]
0->F
While -16
F->{*12+L6}
F+1->F
End
can't hurt to save a byte
OMG. That's insane!
I should just write it in ASM and post the hex.

Code: [Select]
xor a
ld (plotsScreen), a
inc a
ld (plotsScreen+12), a
inc a
ld (plotsScreen+24), a
inc a
ld (plotsScreen+36), a
inc a
ld (plotsScreen+48), a
inc a
ld (plotsScreen+60), a
inc a
ld (plotsScreen+72), a
inc a
ld (plotsScreen+84), a
inc a
ld (plotsScreen+96), a
inc a
ld (plotsScreen+108), a
inc a
ld (plotsScreen+120), a
inc a
ld (plotsScreen+132), a
inc a
ld (plotsScreen+144), a
inc a
ld (plotsScreen+156), a
inc a
ld (plotsScreen+168), a
inc a
ld (plotsScreen+180), a

cause screw loops.
Title: Re: For those of us who dont know binary...
Post by: Binder News on January 22, 2011, 08:34:07 pm
Code: [Select]
ld bc,12
ld a,0
ld hl,plotsScreen
ld (hl),a
inc a
add hl,bc
cp 16
jr z,$-5 ;or maybe 6
Title: Re: For those of us who dont know binary...
Post by: calc84maniac on January 22, 2011, 08:39:59 pm
Unscrew loops!
Code: [Select]
 ld b,15
  ld hl,plotsscreen+12*15
  ld de,-12
loop:
  ld (hl),b
  add hl,de
  djnz loop
  ld (hl),b
Edited due to directional failure
Title: Re: For those of us who dont know binary...
Post by: Builderboy on January 23, 2011, 02:35:04 am
Lols its a battle of the wits
Title: Re: For those of us who dont know binary...
Post by: Runer112 on January 23, 2011, 03:25:13 am
Here are my best attempts. >:D

Axe (will become 6 bytes smaller if Quigibo implements an If :Goto auto-optimization):

Code: (28 bytes) [Select]
16
Lbl L
-1ā†’{*12+Lā‚†}
If {}
Goto L
End

Assembly (this moves the image down 2 rows and right 24 pixels for extreme optimization :P):

Code: (12 bytes) [Select]
ld hl,17*12+3+plotSScreen ;$940F
ld de,-12
ld b,l
loop:
ld (hl),b
add hl,de
djnz loop
ld (hl),b