This is mainly a test for the moment, however, I do plan to upload pokemon purple in its entirety to SC, pending Kerm could add in a folder setup so I can keep things a bit better organized.

Anyways, here is a program I just finished writing out, and will be receiving a rewrite shortly.

http://sc.cemetech.net/?xpi=cd2e799b224231ee816a256f930f32da
ZSMOLD
tifreak8x has just edited this program. The source code now reads:
BASIC Code wrote:
:If X=1:Then
:SetUpEditor∟MT
:1→dim(∟MT
:" →Str7
:41→R:72→S:94→N:0→D:41→A
:67→C:21→D:R→A
:sub("123456",Z,1→Str8
:expr("∟P"+Str8+"(3")→I
:expr("∟P"+Str8+"(9")→J
:expr("∟P"+Str8+"(15")→θ
:expr("∟P"+Str8+"(21")→V
:If max(I={26,28,48,125,132,140,146}) or max(J={26,28,48,125,132,140,146}) or max(θ={26,28,48,125,132,140,146}) or max(V={26,28,48,125,132,140,146:Then
:If max(26={I,J,θ,V:Then
:D+6→D:A-6→A
:A→R
:If length(Str7)>1:Then
:Str7+"CUT/→Str7
:Else
:"CUT/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:26→∟MT(dim(∟MT
:End
:If max(28={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"DIG/"→Str7
:Else
:"DIG/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:28→∟MT(dim(∟MT
:End
:If max(48={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"FLY/→Str7
:Else
:"FLY/→Str7
:End
:dim(∟MT)+1→∟MT(dim(∟MT
:48→∟MT(dim(∟MT
:End
:If max(125={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:C-20→C:S-20→S
:If length(Str7)>1:Then
:Str7+"SOFTBOILED/→Str7
:Else
:"SOFTBOILED/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:125→∟MT(dim(∟MT
:End
:If max(132={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If S>52:Then:S-12→S:C-12→C:End
:If length(Str7)>1:Then
:Str7+"STRENGTH/"→Str7
:Else
:"STRENGTH/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:132→∟MT(dim(∟MT
:End
:If max(140={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"SURF/"→Str7
:Else
:"SURF/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:140→∟MT(dim(∟MT
:End
:If max(146={I,J,θ,V:Then
:If S≠60:Then:S-12→S:C-12→C:End
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"TELEPORT/"→Str7
:Else
:"TELEPORT/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:146→∟MT(dim(∟MT
:End
:End
:If length(Str7)>1:Then
:Str7+"STATS/MOVE/BACK/+→Str7
:dim(∟MT)+1→dim(∟(T
:‾1→∟MT(dim(∟MT
:dim(∟MT)+1→dim(∟MT
:‾2→∟MT(dim(∟MT
:dim(∟MT)+1→dim(∟MT
:‾3→∟MT(dim(∟MT
:End
:
:If length(Str7)=1:Then
:‾{1,2,3→∟MT
:"STATS/MOVE/BACK/+→Str7
:End
:
:
:For(θ,0,D+4
:Line(C-4,θ,94,θ,0
:End
:
:1→F:1→E:W→B
:‾1→W
:While W=‾1
:inString(Str7,"/",F→E
:inString(Str7,"+",1→N
:If E<N:Then
:E-F+1→E
:Text(R,S,sub(Str7,F,E-1
:R+6→R
:F+E→F
:End
:If F≥N
:B→W
:End
:End
:
:If N=2:Then
Generated by SourceCoder, © 2005-2010 Cemetech
This is an automatic post from SourceCoder 2. Report abuse to admin@cemetech.net . You can disable these posts by unchecking the "Post on Update" box in the file's permissions.
I don't see anything horribly terribly unoptimized to change in that; what's your rewrite going to entail? Kudos for using SourceCoder to its full potential. Very Happy
Part of it has to do with this:


Code:
:If length(Str7)>1:Then
:Str7+"CUT/→Str7
:Else
:"CUT/→Str7
:End


I don't need to do that. I can simply add to the string on each bit, and then remove that space at the end of that before I go displaying the text. That will save a tremendous amount of space.

And I am sure I can squeeze more out of it else where. :p I need to update the variables, as some of them aren't being used, and I would like to keep it that way if I can help it.
So, an optimizing help if someone would care to try?


Code:
:If max(I={26,28,48,125,132,140,146}) or max(J={26,28,48,125,132,140,146}) or max(θ={26,28,48,125,132,140,146}) or max(V={26,28,48,125,132,140,146


Been sitting here looking at it, and nothing really comes to mind to optimize. Anyone care to give it a shot?

Edit:

Aaaand, never mind, I think I figured it out by myself. Inspiration is such a silly thing. XD

Edit2:

Essentially this now:


Code:
max({I,J,V,θ}=max({26,28,48,125,132,140,146


Seems to work. going to test more tomorrow.

Edit3:

Upon further testing, it seemed to fail.

suggestions?
That definitely shouldn't work correctly if I'm thinking about this right. Working inside out for the expression:

Code:
max({I,J,V,θ}=max({26,28,48,125,132,140,146

First we look at max({26,28,48,125,132,140,146, which must always return the number 146 if you typed it the same way it is on your calculator. This reduces it to:

Code:
max({I,J,V,θ}=146

Hence, your code is successfully checking all four variables against 146, but not against the whole list of values (as long as I haven't brain-failed).
You are right, dangit. It seemed to work with different values, but now it doesn't. Bleh. *goes and edits the other post*
tifreak8x wrote:
You are right, dangit. It seemed to work with different values, but now it doesn't. Bleh. *goes and edits the other post*
So it seems to me that the best way to do this (in **size** terms) would be a handy use of seq(). Do you have an objection to this; are you going for speed instead? Actually, here's an even easier method that doesn't use seq:


Code:
:{26,28,48,125,132,140,146
:If max(I=Ans)+max(J=Ans)+max(θ=Ans)+max(V=Ans


The seq code would need to construct a 7*4 length list containing {I I I I I I I J J J J J J J θ θ θ θ θ θ θ V V V V V V V} and use augment 3 times to create {26,28,48,125,132,140,146,26,28,48,125,132,140,146,26,28,48,125,132,140,146,26,28,48,125,132,140,146}.
Or even better:

Code:
:{26,28,48,125,132,140,146
:If max(I=Ans or J=Ans or θ=Ans or V=Ans
calc84maniac wrote:
Or even better:

Code:
:{26,28,48,125,132,140,146
:If max(I=Ans or J=Ans or θ=Ans or V=Ans
Ah, of course, my mistake on missing that one. I'd still like to try the seq() idea for elegance, but I don't think I could make it smaller than that.
Hmm, just realized a way to save a byte:

Code:
:2{13,14,24,62.5,66,70,73
:If max(I=Ans or J=Ans or θ=Ans or V=Ans
ZSMOLD
KermMartian has just edited this program. The source code now reads:
BASIC Code wrote:
:If X=1:Then
:SetUpEditor∟MT
:1→dim(∟MT
:" →Str7
:41→R:72→S:94→N:0→D:41→A
:67→C:21→D:R→A
:sub("123456",Z,1→Str8
:expr("∟P"+Str8+"(3")→I
:expr("∟P"+Str8+"(9")→J
:expr("∟P"+Str8+"(15")→θ
:expr("∟P"+Str8+"(21")→V
:2{13,14,24,62.5,66,70,73
:If max(I=Ans or J=Ans or θ=Ans or V=Ans:Then
:If max(26={I,J,θ,V:Then
:D+6→D:A-6→A
:A→R
:If length(Str7)>1:Then
:Str7+"CUT/→Str7
:Else
:"CUT/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:26→∟MT(dim(∟MT
:End
:If max(28={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"DIG/"→Str7
:Else
:"DIG/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:28→∟MT(dim(∟MT
:End
:If max(48={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"FLY/→Str7
:Else
:"FLY/→Str7
:End
:dim(∟MT)+1→∟MT(dim(∟MT
:48→∟MT(dim(∟MT
:End
:If max(125={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:C-20→C:S-20→S
:If length(Str7)>1:Then
:Str7+"SOFTBOILED/→Str7
:Else
:"SOFTBOILED/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:125→∟MT(dim(∟MT
:End
:If max(132={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If S>52:Then:S-12→S:C-12→C:End
:If length(Str7)>1:Then
:Str7+"STRENGTH/"→Str7
:Else
:"STRENGTH/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:132→∟MT(dim(∟MT
:End
:If max(140={I,J,θ,V:Then
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"SURF/"→Str7
:Else
:"SURF/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:140→∟MT(dim(∟MT
:End
:If max(146={I,J,θ,V:Then
:If S≠60:Then:S-12→S:C-12→C:End
:D+6→D:A-6→A:A→R
:If length(Str7)>1:Then
:Str7+"TELEPORT/"→Str7
:Else
:"TELEPORT/→Str7
:End
:dim(∟MT)+1→dim(∟MT
:146→∟MT(dim(∟MT
:End
:End
:If length(Str7)>1:Then
:Str7+"STATS/MOVE/BACK/+→Str7
:dim(∟MT)+1→dim(∟(T
:‾1→∟MT(dim(∟MT
:dim(∟MT)+1→dim(∟MT
:‾2→∟MT(dim(∟MT
:dim(∟MT)+1→dim(∟MT
:‾3→∟MT(dim(∟MT
:End
:
:If length(Str7)=1:Then
:‾{1,2,3→∟MT
:"STATS/MOVE/BACK/+→Str7
:End
:
:
:For(θ,0,D+4
:Line(C-4,θ,94,θ,0
:End
:
:1→F:1→E:W→B
:‾1→W
:While W=‾1
:inString(Str7,"/",F→E
:inString(Str7,"+",1→N
:If E<N:Then
:E-F+1→E
:Text(R,S,sub(Str7,F,E-1
:R+6→R
:F+E→F
:End
:If F≥N
:B→W
:End
:End
:
:If N=2:Then
Generated by SourceCoder, © 2005-2010 Cemetech
This is an automatic post from SourceCoder 2. Report abuse to admin@cemetech.net . You can disable these posts by unchecking the "Post on Update" box in the file's permissions.
Thanks gents. Hoping I will be able to post the new source up later in the next few days.
tifreak8x wrote:
Thanks gents. Hoping I will be able to post the new source up later in the next few days.
Is there a reason you have closing quotes and parentheses on those four expr lines where you initially assign I, J, Theta, and V?
None that I recall. Code is over 2 years old, I think at the time it was more a 'better safe than sorry' bit. *shrugs*

It's omitted from the newer code I am working on.
tifreak8x wrote:
None that I recall. Code is over 2 years old, I think at the time it was more a 'better safe than sorry' bit. *shrugs*

It's omitted from the newer code I am working on.
That makes sense. At any rate, I look forward to this new code that's coming soon.
http://sc.cemetech.net/?xpi=14198ccae6c73f5fdd161469e142f2cf

This code that posts up is the newer version of the party menu creator. It is slow, one thing of it I will have to fix.

The other aspect is that the calc I am testing on completely ignores a section of code. I will post that section up once source coder posts..
ZSM
tifreak8x has just edited this program. The source code now reads:
BASIC Code wrote:
:SetUpEditor∟MT
:1→dim(∟MT
:41→G:72→K:94→N:0→O:G→A:67→C:21→D
:If H=1:Then
:sub("123456",iPart(Z),1→Str7
:expr("∟P"+Str7+"(3→I
:expr("∟P"+Str7+"(4→J
:expr("∟P"+Str7+"(5→θ
:expr("∟P"+Str7+"(6→Q
:2{13,14,24,62.5,66,70,73
:If max(I=Ans or J=Ans or θ=Ans or Q=Ans:Then
:If max(26={I,J,θ,Q:Then
:D+6→D:A-6→A:A→G
:Str7+"CUT/→Str7
:dim(∟MT)+1→dim(∟MT
:26→∟MT(dim(∟MT
:End
:If max(28={I,J,θ,Q:Then
:D+6→D:A-6→A:A→G
:Str7+"DIG/→Str7
:dim(∟MT)+1→dim(∟MT
:28→∟MT(dim(∟MT
:End
:If max(48={I,J,θ,Q:Then
:D+6→D:A-6→A:A→G
:Str7+"FLY/→Str7
:dim(∟MT)+1→dim(∟MT
:48→∟MT(dim(∟MT
:End
:If max(125={I,J,θ,Q:Then
:D+6→D:A-6→A:A→G
:C-20→C:K-20→K
:Str7+"SOFTBOILED/→Str7
:dim(∟MT)+1→dim(∟MT
:125→∟MT(dim(∟MT
:End
:If max(132={I,J,θ,Q:Then
:D+6→D:A-6→A:A→G
:If K>52:Then:K-12→K:C-12→C:End
:Str7+"STRENGTH/→Str7
:dim(∟MT)+1→dim(∟MT
:132→∟MT(dim(∟MT
:End
:If max(140={I,J,θ,Q:Then
:D+6→D:A-6→A:A→G
:Str7+"SURF/→Str7
:dim(∟MT)+1→dim(∟MT
:140→∟MT(dim(∟MT
:End
:If max(146={I,J,θ,Q:Then
:If S≠60:Then:K-12→K:C-12→C:End
:D+6→D:A-6→A:A→G
:Str7+"TELEPORT/→Str7
:dim(∟MT)+1→dim(∟MT
:146→∟MT(dim(∟MT
:End:End:End
:If H=1 or H=2:Then
:Str7+"STATS/MOVE/BACK/+*→Str7
:If dim(∟MT)=1:‾{1,2,3→∟MT
:If dim(∟MT)>1:Then
:dim(∟MT)+3→dim(∟MT
:‾1→∟MT(dim(∟MT)-2
:‾2→∟MT(dim(∟MT)-1
:‾3→∟MT(dim(∟MT:End:End
:If H=1 or H=2:Then
:sub(Str7,3,length(Str7)-2
:
:For(F,0,D+4)
:Line(C-4,θ,94,θ,0
:End:End
:"0ZBD
:prgmZRS
:{N,O,C,D
:prgmTEMP
:prgmZC1
:1→F:W→θ:‾1→W
:While W=‾1
:inString(Str7,"/",F→I%
:inString(Str7,"+",1→N
:If I%>0:Then
:(I%-F)+1→I%
:Text(G,K,sub(Str7,F,I%-1
:G+6→G:F+I%→F
:End
:If I%<0:θ→W:End
Generated by SourceCoder, © 2005-2010 Cemetech
This is an automatic post from SourceCoder 2. Report abuse to admin@cemetech.net . You can disable these posts by unchecking the "Post on Update" box in the file's permissions.

Code:
:If H=1 or H=2:Then
:sub(Str7,3,length(Str7)-2
:
:For(F,0,D+4)
:Line(C-4,θ,94,θ,0
:End:End


This bit here, it is completely and utterly ignored by the calculator, in the sense it refuses to actually run it. I can take this code outside of the program and run it to make it work, but the program itself will not run it.

The calc is an 83+, using OS 1.17, which I know is not a good OS..

Not sure if this is limited to the OS yet or not. Going to dig out a different 83+ soon and test on it.

I have also tried leaving out the If H=1 and H=2:Then ... :End bits, but it still ignores it. Also, the sub string should be:

sub(Str7,2,length(Str7)-1

I tried it at sub(Str7,3,length(Str7)-1 and it errored properly, but it will not run inside the program.

Thoughts?
Not a clue, sorry. Sad I think trial-and-error to track down the precise condition that causes it to ignore that would be your best bet. Regarding the code about that SC2 posted, I feel like there must be a way to take advantage of all the symmetry in those If statements to combine them.
  
Page 1 of 2
» All times are UTC - 5 Hours
 
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

 

Advertisement