This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Project Ideas/Start New Projects => Your Projects
Author Message
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 22 Nov 2005 11:52:45 pm    Post subject:

Test
Edit: Nice! That'll make it easier for converting into HTML.

Quote:
But seriously, I noticed a lot of IDEs seem to use a common color scheme: like green for commenting, blue for commands, etc. 'Don't have a screenshot, but I guess you might know what I'm talking about already.
I know, but I was thinking that maybe I DRAW functions could be one color, CTL another, etc...
Maybe that would be too cluttery, eh?

Here's what I'm thinking so far:
Comments
Green (e.g. // and /*)

Quotes
Red (e.g. "opTI Basic")

Controls
Orange (e.g. If and Else)


DRAW Functions
Olivedrab (e.g. Pxl-On( and ClrDraw)

Input and Output
Mediumslateblue (e.g. Input and ClrHome)

Commands
Blue (e.g. AsmComp( and String->Equ)

Variable/Number Manipulation
Magenta (e.g. + and cos()


Random File:
Quote:
[font="courier new"]:"2X Fasttunnel 1.0
7P
//Comment Here
DelVar SClrHome
Output(2,1,">>>>>>>2X<<<<<<<
Output(3,1,"<<<FastTunnel>>>
Repeat Ans=21 or Ans=105
Output(7,1,">----START-----<>-----EXIT-----<
Output(P,2,"             
P
+(Ans=34 and P=7)-(Ans=25 and P=8P
Output(P,2,"--------------
getKey
End
[color=#008400]/*and here
ClrHome
If P=8
Return
For(A,1,7
just for fun*/


Disp

[/color]End
1P
{0,0,0,2.11L1
2.13B
Repeat (iPart(B)=iPart(L1(P)-1)) or (iPart(B)=4+iPart(L1(P))+(fPart(B)=fPart(L1(P)-1)) or (fPart(B)=.04+fPart(L1(P

Disp

Output(5,iPart(B),"V
Output(5,100fPart(B),"V
Output(8,1,"================
L1(P
+3-4(P>1
Ans+randInt([font="courier new"]
(iPart(Ans)
>1),iPart(Ans)<5)+.01randInt([font="courier new"](fPart(Ans)>.09),fPart(Ans)<.13L1(P
Output(8,iPart(Ans),"   
Output(8,100fPart(Ans),"   
P
+1-4(P=4P
getKey
Output(5,iPart(B),"
Output(5,100fPart(B),"
B
+.01((Ans=15 and fPart(B)<.16)-(Ans=14 and fPart(B)>.01))+(Ans=12 and iPart(B)<16)-(Ans=11 and 1<iPart(BB
S
+1S
End
Output(8,1,"SCORE:
Output(8,7,Ans
If Ans>H
Then
SH
Output(7,4,"NEW HIGH!
End
Output(5,iPart(B),"/*
Output(5,100fPart(B),"/*
Pause
ClrHome

Optimized by opTI-Basic


Last edited by Guest on 25 Nov 2005 03:21:24 pm; edited 1 time in total
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 23 Nov 2005 06:56:16 am    Post subject:

<?php
$string = 'For(X,1,7):End';
$match = '@For\([A-Z],[0-9],([0-9])\):End@';
$replace = 'rand \1';
$string = preg_replace($match, $replace, $string);
$value = preg_replace( '@rand@', '', $string );
echo 2*$value;
?>
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 23 Nov 2005 02:34:09 pm    Post subject:

I've documented every token I'm missing (I think - some might be in the wrong category), so they'll be implemented tonight and syntax highlighting will be done!

Last edited by Guest on 24 Nov 2005 12:56:21 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 23 Nov 2005 02:42:01 pm    Post subject:

Maybe it's just me, but I think that red, orange and magenta are too much alike.
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 23 Nov 2005 02:43:13 pm    Post subject:

Hmm... maybe you're right. So are blue and mediumslateblue. I'll find different colors; any suggestions?

Also, I've been trying this code out on a bunch of forums and noticed that Goosefont's darkblue doesn't work well on some. I'll also add in an option box with different base colors.

Überidea: let the user pick the highlighting!! The options thing will be so crowded, though, that I'm thinking I'll make it either a "More Options->" or a pop-up.
Anyone know how more options can appears when a user clicks on a link? Like:

----------------------------------
[_____TEXTINPUTBOX_____]

More Options [>]

[Optimize]

----------------------------------
[_____TEXTINPUTBOX_____]

Option 1
Option 2
Option 3
Option 4

[Optimize]


Last edited by Guest on 23 Nov 2005 03:06:31 pm; edited 1 time in total
Back to top
axcho


Active Member


Joined: 09 Nov 2004
Posts: 555

Posted: 23 Nov 2005 11:33:01 pm    Post subject:

I would recommend not to allow customization of the syntax highlighting. It is just tedious and most people will choose to leave it as the default. Not only that, but it defeats the purpose of using colors to easily read other people's code.

Also, I think black should be a common color. Right now there is no black at all. Maybe change the DRAW functions to blue and the normal commands to black. Making normal commands a lighter shade of the same color as the comments is not good.
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 24 Nov 2005 12:19:46 am    Post subject:

Good advice... I made the default base color black and gave the option to choose other base colors only.

...and with that, syntax highlighting is all done Smile It was easier than I expected it to be.

Version++


Last edited by Guest on 24 Nov 2005 12:58:54 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 24 Nov 2005 12:56:07 pm    Post subject:

Use bold for commands.
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 24 Nov 2005 07:35:30 pm    Post subject:

Done...

I just noticed that stuff inside comments turn different colors too (not green). I've been working on it and noticed that I can fix it for single-line comments but not comment blocks, at least the way I'm doing it.

Well, I'll fix it sooner or later. Turkey time, now.

-------------------------

Just fixed the colors around. I used a different orange and red to give the most contrast between the two (the colors Dreamweaver use), changed Olivedrab into italics (since it was too close to comment green), and Mediumslateblue into this color.

Greatest thing, though, is that I separated my php code from my HTML, so I was able to... well check it out for yourself! Smile


Last edited by Guest on 25 Nov 2005 03:14:14 pm; edited 1 time in total
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 25 Nov 2005 02:17:34 pm    Post subject:

I was puzzling over comment blocks non-stop since yesterday. When I tried to do it a different way, it magically worked and I finished in 10 minutes!! Check out the updated code above.

So, comment blocks and direct HTML output are up :)


...now back to the optimizations!


Last edited by Guest on 25 Nov 2005 03:22:10 pm; edited 1 time in total
Back to top
kermmartian
Site Admin Kemetech


Calc Guru


Joined: 20 Mar 2004
Posts: 1220

Posted: 25 Nov 2005 08:28:34 pm    Post subject:

Hehe...not to be competitive or anything ( Very Happy ) but sc has 59 optimizations and upcoming editing. Smile
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 26 Nov 2005 05:04:55 pm    Post subject:

Good job, it actually found an optimization in Donut Quest. Of course, that optimization was incorrect, but still...
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 26 Nov 2005 05:14:02 pm    Post subject:

Which one did, Sir Robin?

The son of a [gun] stole my idea Razz


Last edited by Guest on 26 Nov 2005 05:44:05 pm; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 26 Nov 2005 05:17:59 pm    Post subject:

SourceCoder, all that opTI-Basic does is say "Wow, nice prgm. You should submit it to ticalc!" Which is infinitely more helpful.

I'm sorry for KermMartian's thieving ways.
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 26 Nov 2005 05:42:33 pm    Post subject:

lol, I was jk (maybe I should add in the Razz smily)

Try copy-pasting the code from Donut Quest into opTIb...
It also saves one byte Smile . Tonight, I'm adding in many, many more optimizations, so check it again tomorrow if you want.
[CODEBOX][font="courier new"]Full:FnOff :PlotsOff :AxesOff:GridOff:ZStandard:ZInteger
StorePic 1:StorePic 2
SetUpEditor DONUT
1
dim([color=#FF00FF]
LDONUT
[/color]If E3=LDONUT(1
Goto 5
" [[1((XStr0
" Ì](^2)[)YStr1
" 9]1XÌXStr2
" Ì](^2)[)XStr3
" [[1((JStr4
" (^2) XStr5
DelVar [C]{6,7dim([color=#FF00FF]
[C]
3[C](2,1
6→[/color][C](5,1
1[C](2,4
5[C](5,4
LDONUT(1)={175,329,615,807,926
10
+7max(Ansseq[color=darkblue](I,I,1,5M
[/color]Lbl M
ClrDraw
Text(0,30,
"DONUT QUEST
For([color=#FF6600]
I,1,6
Text(7I
+3,10,"LEVEL ",I,
",[color=#FF00FF]sub("PLAIN DONUT A SPLASH! GLAZED DONUTDONUT HOLES LEFT 2 RIGHTDONUT CASTLE",12I-11,12
[/color]End
Text(52,10,
"EXIT GAME
For(J,[font="courier new"][/color]37,37,2
Line(J,24
-M,J,[font="courier new"]20,0
[/color]End
10I
Text(Ans,5,
">
Repeat max(K[color=darkblue]={21,105
Repeat Ans
getKey K
[/color]End
7(K
=34)-7(K=25J
I
+Ans
While Ans>MAns<52
Ans
+J
End
Ans
+49((Ans<10)-(Ans>52
If Ans≠I:Then
Text(Ans,5,
">
Text(I,5,
"
AnsI
End
End
If I=52:Goto Q
int(I[color=darkblue]
/7θ
[/color]Lbl A
8Q:16W
If θ=1:Then
[[7,7,7,7,7,7,7,1,7,7,7,7,7,7,7][7,5,5,5,7,7,1,3,1,7,1,5,1,1,7][7,1,1,1,7,1,3,1,
7,7,3,3,3,3,7][7,3,3,3,7,7,1,3,1,7,1,1,1,1,7][7,1,1,1,7,1,3,1,7,1,3,3,3,3,7][7,1
,
1,1,7,7,1,1,7,7,1,1,1,1,7][7,7,1,1,7,1,1,1,1,7,1,1,7,7,7][7,5,1,1,3,1,1,1,1,3,1,
1
,1,5,7][7,7,1,1,7,1,1,2,1,7,1,1,7,7,7][7,7,7,7,7,7,7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θ=5:Then
[[1,5,1,1,7,3,1,7,1,1,3,1,1,1,4][1,7,1,1,7,1,3,5,1,1,7,1,1,1,1][1,7,1,1,4,3,1,7,
1,6,7,1,3,7,4][1,6,3,3,7,1,3,7,6,1,1,1,5,7,4][2,7,1,1,7,3,1,5,1,6,7,1,3,7,4][1,7
,
1,1,4,1,3,7,6,1,7,1,5,7,4][1,6,3,3,7,3,1,7,1,6,1,1,3,7,4][1,7,1,1,7,1,3,5,6,1,7,
1
,5,7,4][1,7,1,1,4,3,1,7,1,1,7,1,1,1,1][1,5,1,1,7,1,3,7,1,1,3,1,1,1,4[ B ]
5P:1Q
End
If θ=6:Then
[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1][7,1,7,1,7,1,1,1,1,1,7,1,7,1,7][5,1,6,1,5,1,1,1,
1,1,5,1,6,1,5][1,7,5,7,1,1,1,1,1,1,1,7,5,7,1][1,3,1,3,1,7,1,7,1,7,1,3,1,3,1][1,7
,
1,7,7,7,3,7,3,7,7,7,1,7,1][1,3,1,3,1,1,1,1,1,1,1,3,1,3,1][1,7,1,7,1,1,7,3,7,1,1,
7
,1,7,1][1,3,1,3,1,1,6,1,6,1,1,3,1,3,1][4,7,4,7,1,1,7,2,7,1,1,7,4,7,4[ B ]
10PRazzW
End
Lbl 5
DelVar LClrDraw
For([color=#FF6600]
I,2,56,6
DelVar ML+1L
[/color]For([color=#FF6600]
J,2,86,6
M
+1M
[ B ](L,Ans
[/color]If Ans≠1:Then
Text(I,J,
sub(Str0[color=darkblue],Ans,1
Text(I,J
+1,sub(Str1,Ans,1
Text(I,J
+2,sub(Str2,Ans,1
Text(I,J
+3,sub(Str3,Ans,1
Text(I,J
+4,sub(Str4,Ans,1
Text(I,J
+5,sub(Str5,Ans,1
Else
Text(I,J,
"
End
End
Text(I,J,
"
End
1[ B ](P,Q
StorePic 2
[/color]Lbl R
[ B ][A]
PA:QB:WS
DelVar ZgetKey
Repeat Z
Repeat U/V or K=45
getKey K
(Ans
=34)-(Ans=25U
(K
=26)-(K=24V
End
A
+UC:B+VD
If [color=#FF00FF]not(
fPart(C/11)fPart(D/16:Then
If not(S:Goto W
DelVar UDelVar VAC:B→[/color]D
End
6C
-4L:6D-4M
[A](C,D
If Ans=4/K=45:Goto L
If Ans=5:Then
S
-1S
1[A](C,D
Text(L,M,
"
End
Ans
-1G
If Ans:Then
C
+UEVery Happy+VF
If fPart(E/11)fPart(F/16:Then
6E
-4N:6F-4O
[C](G,[A](E,F
If Ans:Then
Text(6A
-4,6B-4,"
Text(L,M,
"
If Ans≠[A](E,F
Text(N,O,
"
StorePic 1
Text(L,M,
"E
Text(L,M
+2,"9
Text(L,M
+4,"[
Text(L,M
+5,"
RecallPic 1
If Ans≠1Ans≠[A](E,F:Then
StorePic 1
Text(N,O,
sub(Str0[color=darkblue],Ans,1
Text(N,O
+1,sub(Str1,Ans,1
Text(N,O
+2,sub(Str2,Ans,1
Text(N,O
+3,sub(Str3,Ans,1
Text(N,O
+4,sub(Str4,Ans,1
Text(N,O
+5,sub(Str5,Ans,1
Text(N,O
+6,"
RecallPic 1
End
Ans[A](E,F
1→[/color][A](C,D
CAVery HappyB
End
End
Else
Text(6A
-4,6B-4,"
StorePic 1
Text(L,M,
"E
Text(L,M
+2,"9
Text(L,M
+4,"[
Text(L,M
+5,"
RecallPic 1
CAVery HappyB
End
End
Lbl W
{175,329,615,807,926,926
max([color=#FF00FF]
LDONUT,Ans(θDONUT
1Z
End
Z
+=6Z
Lbl L
Z
+1Z:End
If Z>1E3=LDONUT(1
Return
If Z=1:Then
Text(20,17,
" YOU LOSE!
Text(26,17,
" ENTER - RESTART
End
If Z=2:Then
Text(20,17,
" YOU WIN!
Text(26,17,
" ENTER - NEXT LEVEL
End
If Z=3:Then
Text(20,17,
" YOU WIN!
Text(26,17,
" ENTER - MAIN MENU
End
Text(32,17,
" CLEAR - EXIT
Line([font="courier new"]
30,[font="courier new"]7,33,[font="courier new"]7,0:Line([font="courier new"]31,[font="courier new"]8,[font="courier new"]31,12:Line([font="courier new"]31,12,34,12:Line(34,12,34,[font="courier new"]8:Line(34,[font="courier new"]8,[font="courier new"]31,[font="courier new"]8
Repeat Ans=45/Ans=105:getKey K:End
If K=45:Goto Q
θ
+(Z=2θ
If Z=2:Goto A
If Z=3:Goto M
ClrDraw:RecallPic 2
Goto R
Lbl Q
DelVar [A]DelVar [ B ]DelVar [C]DelVar Str0DelVar Str1DelVar Str2DelVar Str3DelVar Str4DelVar Str5DelVar Pic1DelVar Pic2ClrDraw:ClrHome

Optimized by opTI-Basic[/CODEBOX]
(yeah... def have some problems with the highlighting there. Gotta fix that soon.
Your matrix [-B-] was being seen as "bold", lol. I'll add in one of Goose's widthless characters.
And what's up with that i=#6B8E23 ? lol...

Last edited by Guest on 27 Nov 2005 04:36:15 pm; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 26 Nov 2005 05:56:33 pm    Post subject:

Both programs make the same mistake of trying to optimize a colon inside quotes. Seems like something else you should fix.

Great job with the color coding! :biggrin:


Last edited by Guest on 26 Nov 2005 06:01:11 pm; edited 1 time in total
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 26 Nov 2005 05:58:18 pm    Post subject:

Will do. Thanks Smile
Back to top
kermmartian
Site Admin Kemetech


Calc Guru


Joined: 20 Mar 2004
Posts: 1220

Posted: 26 Nov 2005 07:09:13 pm    Post subject:

Hehe...actually, I originally thought Brazucs stole my idea, considering I started 7 1/2 months earlier. Very Happy Unfortunately, I started doing optimizations after a suggestion from a forum member (since it IS a Basic Elite project, after all), and I didn't mean to *cough* infringe *cough* on someone else's idea. Wink Glad for some friendly competition. Smile
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 26 Nov 2005 08:03:40 pm    Post subject:

Just a small note on the bolding of commands.

Does it look kind of goofy to anyone else to have the opening `(` in the command bold, but not the closing?
Example:
Quote:
iPart(2AB)


Just a thought... Razz
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 27 Nov 2005 12:10:42 am    Post subject:

Yeah, it does. It should be bolding the last one too... Try it with For( .
I'll find out what's wrong.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
» View previous topic :: View next topic  
Page 7 of 10 » All times are UTC - 5 Hours

 

Advertisement