Woops, sorry. I had used my most recent code (where I added "0" and "9" to it), and when I edited out the zeros after noticing that, I forgot that one Razz That should be a 1

Code:
:If C=1 and D=1
:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0→[A]
:If C=1 and D=2
:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0→[A]
:If C=1 and D=3
:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0→[A]
:If C=1 and D=4
:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0→[A]
:If C=4 and D=4
:[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0→[A]

This is the code for ZMAP1, and the rest are all blocks of 4x4 pieces of the entire overworld, and ZMAP calls the different ZMAPn based on coordinates, and then the particular ZMAPn stores the correct map to [A], then returns to the main game engine and it draws it out.

PS: There are only 0's right now as placeholders until I get to those parts.
Why are you mentioning that? The code Weregoose gave you doesn't care about that; it just cares that C and D are within the bounds in the long program you had before he replaced it with a single line. Smile
Yeah, that's what I just realised. >.<
Sonlen wrote:
Yeah, that's what I just realised. >.<
Wait, what exactly were you trying to do with the code I and Weregoose gave you, then?
Give me a sec and I will post what I was doing.

Code:
:If C≥1 and D≥1 and C≤4 and D≤4
:"ZMAP1"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥1 and D≥5 and C≤4 and D≤8
:"ZMAP2"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥1 and D≥9 and C≤4 and D≤12
:"ZMAP3"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥1 and D≥13 and C≤4 and D≤16
:"ZMAP4"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥1 and C≤8 and D≤4
:"ZMAP5"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥5 and C≤8 and D≤8
:"ZMAP6"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥9 and C≤8 and D≤12
:"ZMAP7"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥13 and C≤8 and D≤16
:"ZMAP8"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
Sonlen wrote:
Give me a sec and I will post what I was doing.
Aight, thanks for that. But you now understand what the purpose of it is, I hope?
Sonlen wrote:
Give me a sec and I will post what I was doing.

Code:
:If C≥1 and D≥1 and C≤4 and D≤4
:"ZMAP1"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥1 and D≥5 and C≤4 and D≤8
:"ZMAP2"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥1 and D≥9 and C≤4 and D≤12
:"ZMAP3"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥1 and D≥13 and C≤4 and D≤16
:"ZMAP4"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥1 and C≤8 and D≤4
:"ZMAP5"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥5 and C≤8 and D≤8
:"ZMAP6"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥9 and C≤8 and D≤12
:"ZMAP7"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:If C≥5 and D≥13 and C≤8 and D≤16
:"ZMAP8"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:real(10,0,1
:prgmXTEMP001
:real(10,1,1


I can see how that'd be kinda crazy Razz
KermMartian wrote:
Sonlen wrote:
Give me a sec and I will post what I was doing.
Aight, thanks for that. But you now understand what the purpose of it is, I hope?

Yes, the sub part adds on to the ZMAP so that is calls the specific one, the "12345678" parts tells it which one exactly.
Sonlen wrote:
KermMartian wrote:
Sonlen wrote:
Give me a sec and I will post what I was doing.
Aight, thanks for that. But you now understand what the purpose of it is, I hope?

Yes, the sub part adds on to the ZMAP so that is calls the specific one, the "12345678" parts tells it which one exactly.
Exactly. Notice that your code, as written, will yield "ZMAP11", "ZMAP22", "ZMAP33", but NOT anything like "ZMAP1" or "ZMAP35". If you don't understand why I'm saying that, try (mentally) plugging in a valid pairs of values of C and D and see what happens.
KermMartian wrote:
Sonlen wrote:
KermMartian wrote:
Sonlen wrote:
Give me a sec and I will post what I was doing.
Aight, thanks for that. But you now understand what the purpose of it is, I hope?

Yes, the sub part adds on to the ZMAP so that is calls the specific one, the "12345678" parts tells it which one exactly.
Exactly. Notice that your code, as written, will yield "ZMAP11", "ZMAP22", "ZMAP33", but NOT anything like "ZMAP1" or "ZMAP35". If you don't understand why I'm saying that, try (mentally) plugging in a valid pairs of values of C and D and see what happens.

Well you just confused me for 1, but it does work. Very Happy
I know I confused you, but don't let yourself stay confused. Do what I suggest, create C and D in your mind, then run through the program, including conditionals and sub()s and stuff, line by line, and you'll see why the If statements are superfluous.
I am going to assume you mean how it has to check C and D 2 times per If, and in all 16 times, not to mention the math it has to do over and over, is that what you are getting at.
Sonlen wrote:
I am going to assume you mean how it has to check C and D 2 times per If, and in all 16 times, not to mention the math it has to do over and over, is that what you are getting at.
But that's the thing, it doesn't, it only does it once! Because you're already doing If [statement on C and D], you already know which of {12345678} you're using before the sub() starts. You could just switch back to "ZMAPN under each of those If statements.
Blinders. Off. Now.


Code:
:If C≥1 and D≥1 and C≤4 and D≤4
:"ZMAP1
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥1 and D≥5 and C≤4 and D≤8
:"ZMAP2
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥1 and D≥9 and C≤4 and D≤12
:"ZMAP3
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥1 and D≥13 and C≤4 and D≤16
:"ZMAP4
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥5 and D≥1 and C≤8 and D≤4
:"ZMAP5
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥5 and D≥5 and C≤8 and D≤8
:"ZMAP6
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥5 and D≥9 and C≤8 and D≤12
:"ZMAP7
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:If C≥5 and D≥13 and C≤8 and D≤16
:"ZMAP8
:real(10,0,1
:prgmXTEMP001
:real(10,1,1
:Return


=/equals/is the same as/has zero deviation from


Code:
:"ZMAP"+sub("12345678",1+4int(C/4-4‾¹)+int(D/4-4‾¹),1
:real(10,0,1
:prgmXTEMP001
:real(10,1,1


The latter doesn't just replace one section of the former; it replaces ALL of it. I've done the math, rigorously tested it, and explained the logic to you. It would be a far better learning experience if were to try to break down your code exactly as I have done before, rather than senselessly expanding my code toward yours. I assure you that, down to the last minutiae of every conceivable factor, the routines have 100% corresponding input-to-output behaviors; they are completely and utterly and irrefutably identical. (Assuming that C<1 or D<1 or C>8 or D>16 is always untrue in the context of this routine.)

Overall, your assumption that the code is broken is driving me bonkers.
Weregoose wrote:

The latter doesn't just replace one section of the former; it replaces ALL of it. I've done the math, rigorously tested it, and explained the logic to you. It would be a far better learning experience if were to try to break down your code exactly as I have done before, rather than senselessly expanding my code toward yours. I assure you that, down to the last minutiae of every conceivable factor, the routines have 100% corresponding input-to-output behaviors; they are completely and utterly and irrefutably identical. (Assuming that C<1 or D<1 or C>8 or D>16 is always untrue in the context of this routine.
If you glance through this thread and IRC logs, you'll see I tried to get that point across several times to no avail. Sad
how would you make a single variable equal more then one number.
for example:

randint(1,5)->A
if A<3
then
disp "yo"
pause
end
if A>4
then
disp "yo mo"
pause
end
if A=3,4
then
disp "hello"
pause
end


the problem I am encountering is that the last part dose not work
how could i do it with out doing this.

if A=3
then
disp "hello'
pause
end
if A=4
then
disp
pause
end
You're probably looking for " or " Smile
Instead of something like "A=3,4" (which, as you know, fails), you can use "A=3 or A=4" (" or " is in the test menu, logic column. [Test is 2nd+Math]. Just in case you didn't know Very Happy)
KermMartian wrote:
Weregoose wrote:

The latter doesn't just replace one section of the former; it replaces ALL of it. I've done the math, rigorously tested it, and explained the logic to you. It would be a far better learning experience if were to try to break down your code exactly as I have done before, rather than senselessly expanding my code toward yours. I assure you that, down to the last minutiae of every conceivable factor, the routines have 100% corresponding input-to-output behaviors; they are completely and utterly and irrefutably identical. (Assuming that C<1 or D<1 or C>8 or D>16 is always untrue in the context of this routine.
If you glance through this thread and IRC logs, you'll see I tried to get that point across several times to no avail. Sad


So I am assuming you have been trying to say something to me, and I have not yet believed you? If you have been saying that, it's not that I don't believe you, it is that I have not noticed that, or it didn't quite hit me.
That reply was rooted in A) my understanding from IRC logs that you were having trouble running the code, which indicated to me that you weren't using it in the way it was provided, and B) my seeing where you had duplicated the code eight times over, which confirmed that understanding. I even explained exactly what the code does and how it was derived before your problems showed up. Anyway, sorry if I overreacted.

@Zerocode: You can write text (in quotes) on the same line as a Pause. Try it and see what it does. Smile
  
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  Next
» View previous topic :: View next topic  
Page 4 of 6
» 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