Author Topic: [project] Drawing to basic.  (Read 15835 times)

0 Members and 1 Guest are viewing this topic.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
[project] Drawing to basic.
« on: September 28, 2010, 07:37:35 pm »
Written by: Happybobjr of Happybobjr Prod.
Assisted by: (contact me if you helped, I don't remember who all helped (ie. people in irc))
               *Nemo (Code Optimization)

Drawing to basic- still in early stages, will allow you to draw a picture. After exiting the program, you will see you have a new program, PIC1.
The point of this project is to allow ti-basic coders to have pictures in there program without worrying about bulky or annoying picture variables.

Version: 1.7.0
Compile in 0.4.5!  for best results. ;)


Change Log:  Now has Text.
                    Adjustable cross-hairs.
                    X: for full
                    /(division): for adjustable
                    +: larger cross-hair
                    - : smaller cross-hair

Download: http://www.omnimaga.org/index.php?action=dlattach;topic=4619.0;attach=3938

Please submit all problems or optimizations.



/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Spoiler For Spoiler:
Version 1.0.00001 V
Spoiler For Spoiler:
Written by: Happybobjr of Happybobjr Prod.
Assisted by: (contact me if you helped, I don't remember who all helped (ie. people in irc)

Drawing to basic, still in early stages, will allow you to draw a picture. After exiting the program, you will see you have a new program, PIC1.
The point of this project is to allow ti-basic coders to have pictures in there program without worrying about bulky or annoying picture variables.

Version 1.0.00001


Features:
*Drawing of lines.
*Pointer (gray) for pointer location.
*Preset Xmin, Xmax, Ymin, Ymax, Axisoff variables.


Bugs:
*The pointer is a little faint.
*You have random junk at end of PIC1. (seperated from good code by eight spaces.)
*if coordinates are less than 10, PIC1 will have 0X  (00,01,02,03.......)
*You must press enter after you press clear to end the program.


Commands:
*ENTER- Puts point/line on screen at location of the pointer.
*CLEAR- Ends program. (must press enter afterwards to actually finish closing (Due to my not wanting to experiment)


Upcoming Features:
*circle drawing


My code:
Code: [Select]

.BA

.MESSAGE ME IF
.YOU DESERVE
.CREDIT


ClrDraw:ClrDrawr:
GEtCalc("prgmPIC1",700)->Z
[3004630A3E393404630B3E310463023E310463033E3004630C3E363304630D3F7E093F853F]->Str1
Copy(Str1,Z,37
37->S
0->X->Y->A->N
REpEat N=1
PausE 500
REpEat gEtKEy(9)
If gEtKEy(15):1->N:End

If X<95 and gEtKEy(3):X+1->X:PausE 30:End
If Y>0 and gEtKEy(4):Y-1->Y:PausE 30:End
If X>0 and gEtKEy(2):X-1->X:PausE 30:End
If Y<62 and gEtKEy(1):Y+1->Y:PausE 30:End
DispGraphr
ClrDrawr
Pxl-On(X,Y)r
PausE 1
End

Pxl-On(X,Y)

If A=0
E9C->{Z+S}:S+1->S:X->D:Y->E
D->I:62-E->J
End
If A=1
X->F:Y->G
F->K:62-G->L
LinE(D,E,F,G)
End
For(M,1,2)
If M=1 and (A=0):I->H:End
If M=2 and (A=0):J->H:End
If M=1 and (A=1):K->H:End
If M=2 and (A=1):L->H:End
If H(</=)9:E30->{Z+S}:S+1->S:End
If H(</=)19 and (H(>/=)10):E31->{Z+S}:S+1->S:H-10->H:End
If H(</=)29 and (H(>/=)20):E32->{Z+S}:S+1->S:H-20->H:End
If H(</=)39 and (H(>/=)30):E33->{Z+S}:S+1->S:H-30->H:End
If H(</=)49 and (H(>/=)40):E34->{Z+S}:S+1->S:H-40->H:End
If H(</=)59 and (H(>/=)50):E35->{Z+S}:S+1->S:H-50->H:End
If H(</=)69 and (H(>/=)60):E36->{Z+S}:S+1->S:H-60->H:End
If H(</=)79 and (H(>/=)70):E37->{Z+S}:S+1->S:H-70->H:End
If H(</=)89 and (H(>/=)80):E38->{Z+S}:S+1->S:H-80->H:End
If H(</=)99 and (H(>/=)90):E39->{Z+S}:S+1->S:H-90->H:End

If H=0:E30->{Z+S}:End
If H=1:E31->{Z+S}:End
If H=2:E32->{Z+S}:End
If H=3:E33->{Z+S}:End
If H=4:E34->{Z+S}:End
If H=5:E35->{Z+S}:End
If H=6:E36->{Z+S}:End
If H=7:E37->{Z+S}:End
If H=8:E38->{Z+S}:End
If H=9:E39->{Z+S}:End
S+1->S
If A=0 or ((A=1) and (M=1))
E2B->{Z+S}:S+1->S:End
If A=1 and (M=2):E3F->{Z+S}:1+S->S:End
End
A+1->A
If A=2:0->A
End
End

Copy([3F3F3F3F3F3F3F3F],Z+S,8

Screenies: (will be edited in)

Download Link: http://www.omnimaga.org/index.php?action=dlattach;topic=4619.0;attach=3511
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Version 1.1.3 V
Spoiler For Spoiler:

Features:
*Drawing of lines.
*Pointer (gray) for pointer location.
*Preset Xmin, Xmax, Ymin, Ymax, Axisoff variables and clear draw.


Bugs:
*The pointer is a little faint.
*You have random junk at end of PIC1. (seperated from good code by eight spaces.)
*If coordinates are less than 10, PIC1 will have 0X  (00,01,02,03.......)
*You must press enter after you press clear to end the program.


Commands:
* 2nd- Puts point/line on screen at location of the pointer.
* CLEAR- Ends program.
* Alpha- Will switch you between Line mode and Circle mode


Upcoming Features:
*circle drawing


Change Log
* A few optimizations. (No effect on outcome program)
* Mode for drawing circles added. (Circle drawing not implemented yet)
* (In code) Moved # to token into a sub program. (for future features)


My code:
Code: [Select]
.BA

.MESSAGE ME IF
.YOU DESERVE
.CREDIT


ClrDraw:ClrDrawr
GetCalc("prgmPIC1",700)->Z
Copy([3004630A3E393404630B3E3004630C3E363204630D3F7E093F853F],Z,27)
27->S
0->X->Y->A->N->T+1->B


Repeat N
Pause 500
Repeat getKey(54)
getKey->C
If getKey(15):Copy([3F3F3F3F3F3F3F3F],Z+S,8:Return:End

While C>4 and (C(=/=)54):getKey->U:!If U:U->C:End
If getKey(48) and (C=48)
B+1->B:If B=3:1->B:End:End

ClrHome
If B=1:Text(5,5,"LINE":While getKey(48):End:End

If B=2:Text(5,5,"CIRCLE":While getKey(48):End:End
Pause 150
End

If B=1 or (B=2 and (T=1))
If X<94 and getKey(3):X+1->X:Pause 30:End:End

If B=1 or (B=2 and (T=2))
If Y>0 and getKey(4):Y-1->Y:Pause 30:End:End
If X>0 and getKey(2):X-1->X:Pause 30:End
If Y<62 and getKey(1):Y+1->Y:Pause 30:End





DispGraphr
ClrDrawr
Pxl-On(X,Y)r
Pause 1
End


If B=1
Pxl-On(X,Y)
If A=0
E9C->{Z+S}:S+1->S:X->D:Y->E
D->I:62-E->J
End
If A=1
X->F:Y->G
F->K:62-G->L
Line(D,E,F,G)
End
For(M,1,2)
If M=1 and (A=0):I->H:End
If M=2 and (A=0):J->H:End
If M=1 and (A=1):K->H:End
If M=2 and (A=1):L->H:End
sub(SUB)
If A=0 or ((A=1) and (M=1))
E2B->{Z+S}:S+1->S:End
If A=1 and (M=2):E3F->{Z+S}:1+S->S:End
End
A+1->A
If A=2:0->A
End
End
End


Lbl SUB
!If H/10->R:E30->{Z+S}:End
If R=1:E31->{Z+S}:H-10->H:End
If R=2:E32->{Z+S}:H-20->H:End
If R=3:E33->{Z+S}:H-30->H:End
If R=4:E34->{Z+S}:H-40->H:End
If R=5:E35->{Z+S}:H-50->H:End
If R=6:E36->{Z+S}:H-60->H:End
If R=7:E37->{Z+S}:H-70->H:End
If R=8:E38->{Z+S}:H-80->H:End
If R=9:E39->{Z+S}:H-90->H:End
S+1->S
If H=0:E30->{Z+S}:End
If H=1:E31->{Z+S}:End
If H=2:E32->{Z+S}:End
If H=3:E33->{Z+S}:End
If H=4:E34->{Z+S}:End
If H=5:E35->{Z+S}:End
If H=6:E36->{Z+S}:End
If H=7:E37->{Z+S}:End
If H=8:E38->{Z+S}:End
If H=9:E39->{Z+S}:End
S+1->S
Return


Screenies:
                     Instead of 716 bytes or whatever for a pic. var now it is 195.  Did we really want 716 bytes for such a simple pic.?
                     If we fix the 00's to just 0, it will be just 175 byes!
                     If we remove the first part, setting zoom and everything, it goes down to 150 bytes!



Download Link: http://www.omnimaga.org/index.php?action=dlattach;topic=4619.0;attach=3544



Any thoughts, comments, complaints, rants, trolling, peanuts etc. are all welcome here.
||
V
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Version 1.2.2 V
Spoiler For Spoiler:

Features:
*Drawing of lines.
*Drawing of Circles
*Drawing of Points
*Pointer (cross-hairs) for pointer location.
*Preset Xmin, Xmax, Ymin, Ymax, Axisoff variables and clear draw.


Bugs:
*You have random junk at end of PIC1. (seperated from good code by eight spaces.)
*If coordinates are less than 10, PIC1 will have 0X  (00,01,02,03.......)
*Circles suck :P

Commands:
* 2nd- Puts point/line on screen at location of the pointer.
* CLEAR- Ends program.
* Alpha- Will switch you between Line mode and Circle mode



Change Log
* Mode for drawing circles added.
*Points added.

My code:
Code: [Select]
No code

Any thoughts, comments, complaints, rants, trolling, peanuts etc. are all welcome here.
||
V

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Version 1.3.1

Features:
*Drawing of lines.
*Drawing of points
*Cross-hair pointer location.
*Preset Xmin, Xmax, Ymin, Ymax, Axisoff variables and clear draw.


Bugs:
*You have random junk at end of PIC1. (seperated from good code by eight spaces.)


Commands:
* 2nd- Puts point/line on screen at location of the pointer.
* CLEAR- Ends program.
* Alpha- Will switch you between Line mode and Point mode



Change Log
*Circles removed
*Fixed 00 bug.
*Optimized code slightly


My code:
Code: [Select]



Download Link: http://www.omnimaga.org/index.php?action=dlattach;topic=4619.0;attach=3582


Any thoughts, comments, complaints, rants, trolling, peanuts etc. are all welcome here.
||
V
« Last Edit: October 20, 2010, 06:47:49 pm by happybobjr »
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 meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: [project] Drawing to basic.
« Reply #1 on: September 28, 2010, 08:05:34 pm »
Just tried it out. Looking good. Couple things though. I would add what the controls are because I don't know them and such and is a little disorienting. I would also use [2ND] the button to put a point down, instead of [ENTER]. For the actual program it creates I would put a option later in that lets you choose either 62→Ymax or -62→Ymin. Also, don't mess with the scaling the axes. It does basically nothing unless you have axes turned on. A better way to get to those settings are:

Code: [Select]
ZStandard
104→Xmax
72→Ymax
ZInteger

or

Code: [Select]
ZStandard
104→Xmax
-72→Ymin
ZInteger
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: [project] Drawing to basic.
« Reply #2 on: September 28, 2010, 08:08:36 pm »
Or, to be faster, use one of these:
0->Xmin
-62 or 0->Ymin
1->deltaX
1->deltaY

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: [project] Drawing to basic.
« Reply #3 on: September 28, 2010, 08:20:43 pm »
Ya, that works too. Mines smaller, his is faster.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: [project] Drawing to basic.
« Reply #4 on: September 28, 2010, 08:21:49 pm »
I think i'd prefer size in this position.  After all its not like you need uber fast speed when resizing the windows :P

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: [project] Drawing to basic.
« Reply #5 on: September 28, 2010, 08:24:46 pm »
I think i'd prefer size in this position.  After all its not like you need uber fast speed when resizing the windows :P
Me too.  I just threw the routine out there. :)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: [project] Drawing to basic.
« Reply #6 on: September 28, 2010, 08:57:12 pm »
Ya, me too. I mean speed wise I don't think there is that much of a difference anyways.

Off-Topic:
Doesn't Exodus use the speed routine?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: [project] Drawing to basic.
« Reply #7 on: September 28, 2010, 09:00:16 pm »
TROLL.

J/k.

Pretty good, nice job. Hope you can fix those bugs...

EDIT: IMO you should go for the faster option. It's going to be used inside TI-BASIC programs, anyway.
« Last Edit: September 28, 2010, 09:01:09 pm by Deep Thought »




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: [project] Drawing to basic.
« Reply #8 on: September 28, 2010, 09:10:20 pm »
TROLL.

J/k.

Pretty good, nice job. Hope you can fix those bugs...

EDIT: IMO you should go for the faster option. It's going to be used inside TI-BASIC programs, anyway.

Well you have to remember it's only a fraction of a second faster.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [project] Drawing to basic.
« Reply #9 on: September 28, 2010, 09:14:37 pm »
thanks for the help.

Any suggestions how to deal with the size of PrgmPIC1?
with the random junk at the end.
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 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: [project] Drawing to basic.
« Reply #10 on: September 28, 2010, 09:30:41 pm »
TROLL.

J/k.

Pretty good, nice job. Hope you can fix those bugs...

EDIT: IMO you should go for the faster option. It's going to be used inside TI-BASIC programs, anyway.

Well you have to remember it's only a fraction of a second faster.

Yeah, but in games if you call it often enough even a fraction of a second make a huge difference ;)




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: [project] Drawing to basic.
« Reply #11 on: September 28, 2010, 09:38:07 pm »
TROLL.

J/k.

Pretty good, nice job. Hope you can fix those bugs...

EDIT: IMO you should go for the faster option. It's going to be used inside TI-BASIC programs, anyway.

Well you have to remember it's only a fraction of a second faster.

Yeah, but in games if you call it often enough even a fraction of a second make a huge difference ;)

But when do you need to constantly change the window? I don't think I've ever seen that before.

As for the problem, I'm sorry I can't help. I'm not experienced that much in Axe.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [project] Drawing to basic.
« Reply #12 on: September 28, 2010, 09:58:31 pm »
is there any way i can use decimal points in axe? effectively?
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 calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: [project] Drawing to basic.
« Reply #13 on: September 28, 2010, 10:00:02 pm »
Fixed point, used with ** for multiplication. Let me see if I can find another topic that asks about this...
Edit: Here we are. http://ourl.ca/7084
Edit 2: 1100th post! ;D
« Last Edit: September 28, 2010, 10:02:44 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: [project] Drawing to basic.
« Reply #14 on: September 28, 2010, 10:02:14 pm »
Here is the topic Sir started asking about it. Probably some info in there :)

Off-Topic:
2000! Woohoo!
« Last Edit: September 28, 2010, 10:02:45 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)