Don't have an account? Register now to chat, post, use our tools, and much more.
Online Users
There are 89 users online: 0 members, 63 guests and 26 bots.
Members: None.
Bots: VoilaBot (3), Spinn3r (1), MSN/Bing (1), VoilaBot (2), Yahoo! Slurp (1), Googlebot (18).
SAX
Author Message
GenericUser1

Joined: 03 May 2007
Posts: 288

 Posted: 04 Oct 2007 02:55:16 pm    Post subject: String problem [Solved (to an extent)] OK, I have this code: Code: ```:¦ If θ=22 :¦ Then :¦ Output(5,7,"< > :¦ Repeat Z=22 :¦ ¦ Output(5,8,sub(Str1,G,1 :¦ ¦ getKey→Z :¦ ¦ Repeat Z :¦ ¦ ¦ getKey→Z :¦ ¦ End :¦ ¦ G-(Z=24 and G≠1)+(Z=26 and G+1≤length(Str1))→G :¦ ¦ If Z=21 :¦ ¦ sub(Str2,1,F-(5-D)∟EDIT(2)-E-5)+sub(Str1,G,1)+sub(Str2,F-(5-D)∟EDIT(2)-E-3,length(Str2)-length(sub(Str2,1,F-(5-D)∟EDIT(2)-E-3)))→Str2 :¦ End :End``` And I need it corrected. More specifically the 3rd to last line, teh one with all the sub(s WHat it is suppoesed to do is take the cursor's position (D = UP and Down, E= Left and right), along with the centerpoint (F, should be (5,8) on the screen if you were to plot it, 72 on an 16*8 map), the width of the map (∟EDIT(2)) and the Str2 as the map itself. G is the point in Str1 of which I am trying to move to the point of the cursor. Any one have an idea?  Solved. Figured it out (to an extent).Last edited by GenericUser1 on 04 Oct 2007 05:07:53 pm; edited 2 times in total
JoostinOnline

Joined: 22 Sep 2007
Posts: 48
Location: Behind You

 Posted: 04 Oct 2007 04:12:35 pm    Post subject: Re: String problem I don't know about fixing your problem, but I did optimize your code a bit Code: ```:¦ If θ=22 :¦ Then :¦ Output(5,7,"< > :¦ Repeat Z=22 :¦ ¦ Output(5,8,sub(Str1,G,1 :¦ ¦ Repeat Ans :¦ ¦ ¦ getKey :¦ ¦ End :¦ ¦Ans→Z :¦ ¦ G-(Z=24 and G≠1)+(Z=26 and G+1≤length(Str1→G :¦ ¦ If Z=21 :¦ ¦ sub(Str2,1,F-(5-D)∟EDIT(2)-E-5)+sub(Str1,G,1)+sub(Str2,F-(5-D)∟EDIT(2)-E-3,length(Str2)-length(sub(Str2,1,F-(5-D)∟EDIT(2)-E-3→Str2 :¦ End :End```_________________"Macs are the Perfect Computer", said the Perfect Idiot. Testing for: Vera
GenericUser1

Joined: 03 May 2007
Posts: 288

 Posted: 04 Oct 2007 04:22:00 pm    Post subject: I'm not worried about the optimization, I'll do that later when it is complete. I just need to figure out the 3rd line... and how I would change the symbol in the first and last spaces... And I'm a little against using Ans atm... I sorta solved it... For some reason, it shows the symbol i just put in on the second line on the first to the right by about 6... I wonder why?  Solved completely! Screwed up a + and a - in the output. I'll upload ASAP. Should some sort of open-a-preexisting-map be allowed?
Super Speler

Joined: 12 Dec 2006
Posts: 248

 Posted: 04 Oct 2007 09:56:10 pm    Post subject: Why would you be against the use of Ans? Do you not like good code or something?
Kllrnohj

PH34R |\/|3

Joined: 24 May 2005
Posts: 8189

Posted: 04 Oct 2007 11:16:18 pm    Post subject:

 Super Speler wrote: Why would you be against the use of Ans? Do you not like good code or something?

He said "atm" (at the moment) - you never ever optimize something until it works. Also, he may add to it and use what is in ans later, so storing it for now is a good idea. He can always go back and optimize later.
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Super Speler

Joined: 12 Dec 2006
Posts: 248

 Posted: 05 Oct 2007 02:17:54 pm    Post subject: I got the impression of him being against using Ans in general, not just for this. Maybe (probably) I was wrong though.
GenericUser1

Joined: 03 May 2007
Posts: 288

 Posted: 05 Oct 2007 02:24:29 pm    Post subject: Kllrnohj is right, write he code out first and then optomize. I mean, if you optomize while you do it, a) it takes to long and b) if you mess up just a little, it could be problematic. And for some reason the archives aren't working... My thing won't download. A blank page shows up.
KermMartian

Joined: 14 Mar 2005
Posts: 55733
Location: Earth, Sol, Milky Way

Posted: 05 Oct 2007 03:36:23 pm    Post subject:

 Angel14995 wrote: Kllrnohj is right, write he code out first and then optomize. I mean, if you optomize while you do it, a) it takes to long and b) if you mess up just a little, it could be problematic. And for some reason the archives aren't working... My thing won't download. A blank page shows up.
There's already a separate topic about it. I'll try to get to it later if I have a chance.
_________________

GenericUser1

Joined: 03 May 2007
Posts: 288

 Posted: 06 Oct 2007 12:40:38 pm    Post subject: Okay. I didn't see the topic when I wrote my post, so sorry.
KermMartian

Joined: 14 Mar 2005
Posts: 55733
Location: Earth, Sol, Milky Way

Posted: 06 Oct 2007 05:51:47 pm    Post subject:

 Angel14995 wrote: Okay. I didn't see the topic when I wrote my post, so sorry.
_________________

 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
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.

»
 Page 1 of 1 » All times are GMT - 5 Hours

 Jump to: Select a forum Announcements----------------Cemetech AnnouncementsCemetech LabsContests General Discussion----------------Technology & Calculator Open Topic-- Electronics/Hardware Development-- Calculator HardwareYour ProjectsGeneral Open Topic-- Politics & Rants-- Reviews-- Humour/Jokes Cemetech's Projects----------------Doors CSSourceCoderMember Features-- TI-Freak8x-- Merthsoft-- GrammerOther & Upcoming Projects-- The BASIC Elite-- mobileTunes-- CALCnet 2.2-- SuggestionsProgramming the TI-83 Plus/TI-84 PlusUsing the TI-83 Plus/TI-84 PlusWebsite Programming & Design----------------General Programmingz80 AssemblyTI-BASICCasio Prizm/FX Development & ProgrammingWebsite Markup & ScriptingGraphics1337 Programming Tips Building with Blocks----------------FreeBuild, LEGO, and Minecraft-- FreeBuild General-- Suggestions & Troubleshooting-- Content & Gallery-- Servers & Activities
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.028652 seconds.