| View previous topic :: View next topic |
| Author |
Message |
Sage Orator Not worth mentioning
Joined: 07 Aug 2007 Posts: 9
|
Posted: Fri Aug 10, 2007 11:46 pm Post subject: need help with problem |
|
|
I'm working on optimizing calcmanic's raycaster and I've, as suggested, used a list to store the final info. Problem is, the ClearDraw before the drawing routine doesn't register. Neither does the | Code: | | Pause checkTmr(theta |
| Code: | [[1,1,1,1,1,1,1][1,0,0,0,0,0,1][1,0,1,0,1,0,1][1,0,1,0,0,0,1][1,0,1,1,1,0,1][1,0,0,0,0,0,1][1,1,1,1,1,1,1->[A]
"10101011110111101010110111011010101111011110101011011101->Str1
AxesOff
FnOff
PlotsOff
ZStandard
ZInteger
Radian
DelVar RDelVar C2.5->A
Ans->B
pi/6->D
Repeat theta=45
startTmr->T
For(Z,C-D,C+D,pi/95
R+1->R
sin(Z->V
E2->M
cos(Z->U
If Ans
Then
(U>0)-(U<0->Q
–Ans-A-Ans(int(–AnsA->P
A+Ans->PMT
V/U->E
B+PAns->FV
QE->I%
(Q<0->PV
Repeat Ans
PMT+Q->PMT
FV+I%->FV
If 8>FV>=1
Then
[A](int(FV),PMT-PV
Else
2
End
End
If Ans=/2
Then
(PMT-A)/U->M
End
7int(8fPart(FV+1/16->K
End
If V
Then
0+(V>0)-(V<0->Q
–Ans-B-Ans(int(–AnsB->P
B+Ans->FV
U/V->F
A+PAns->PMT
(Q<0->PV
QF->I%
Repeat Ans
FV+Q->FV
PMT+I%->PMT
If 8>PMT>=1
Then
[A](FV-PV,int(PMT
Else
2
End
End
If Ans=/2
Then
(FV-B)/V
If Ans<M
Then
Ans->M
7int(8fPart(PMT+1/16->K
End
End
End
Z-C->L
285/pi(L->L1(R
30/(7Mcos(L->L2(R
End
ClrDraw
For(S,1,dim(L1
L2(S->P:L1(S->Q
2P-1->G
For(X,0,6
If "1"=sub(Str1,K+X+1,1
Then
P(2X-7
Line(Q+1,Ans,Q+1,Ans+G
Line(Q+3,Ans,Q+3,Ans+G
End
End
End
Pause checkTmr(T
Repeat Ans
getKey->theta
End
C+pi((Ans=26)-(Ans=24->C
A+cos(C)(theta=25)-cos(C)(theta=34->A
B+sin(C)(theta=25)-sin(C)(theta=34->B
End |
Any ideas as to why? Optimizations would be nice too, especially with the drawiing routine. |
|
| Back to top |
|
 |
JoostinOnline Modtastic

Joined: 20 Aug 2007 Posts: 60 Location: Behind You
|
Posted: Mon Nov 05, 2007 9:39 pm Post subject: |
|
|
That looks pretty optimized to me. I see a few changes that could be made, but I don't think you should do anything to it until you fix the problems. What OS are you using? I am guessing that is your problem. _________________ "Macs are the Perfect Computer", said the Perfect Idiot.
Testing for:
Vera |
|
| Back to top |
|
 |
Xphoenix Modtastic

Joined: 20 Jun 2007 Posts: 82 Location: [varies]
|
Posted: Mon Nov 05, 2007 11:16 pm Post subject: |
|
|
Program plzkthx.
No, really, I'm not too fond of the idea of converting that stuff to correct tokens, but I'll try if I have time. I'm going to assume "=/" means not equal to.
This code:
Is weird.
Should just be:
At the third to last line, replace the "C"s with "Ans"s.
I don't see a
| Code: |
:Pause checkTmr(theta
|
Do you mean checkTmr(T)?
| Code: |
(U>0)-(U<0->Q
–Ans-A-Ans(int(–AnsA->P
A+Ans->PMT
|
to:
| Code: |
(U>0)-(U<0->Q
–Ans-Ans(int(–AnsA->PMT
Ans-A->P
|
I think. _________________ 如果你能看得懂這個句子,送我一個PM。
Once an Xp...Always an Xp.  |
|
| Back to top |
|
 |
JoostinOnline Modtastic

Joined: 20 Aug 2007 Posts: 60 Location: Behind You
|
Posted: Mon Nov 05, 2007 11:30 pm Post subject: |
|
|
Wow, I should have looked over the rest of the code. I just looked for loops/conditions that might make the program ignore ClrDraw. I'm glad XP looked over this . _________________ "Macs are the Perfect Computer", said the Perfect Idiot.
Testing for:
Vera |
|
| Back to top |
|
 |
Xphoenix Modtastic

Joined: 20 Jun 2007 Posts: 82 Location: [varies]
|
Posted: Tue Nov 06, 2007 12:17 am Post subject: |
|
|
I'm not entirely sure, but I think the leading 0 isn't needed.
Oops, just noticed, this is 84+(SE) only. No wonder PTI is spitting errors at me.
Oh, wait, that means. . . Are you using 83+ Graphlink? It won't tokenize those timer commands correctly.
I tested on my 84+. It draws what appears to be the beginning of a maze (maybe 1/6 of something like in Doom 89), then pauses with a "24." After that, it goes into a getKey loop. When I push a key, I get "ERR: INVALID DIM" on this line:
Second trial had 26, with same error. _________________ 如果你能看得懂這個句子,送我一個PM。
Once an Xp...Always an Xp.  |
|
| Back to top |
|
 |
Pseudoprogrammer Modtastic
Joined: 18 Jan 2007 Posts: 44 Location: Down South Y'all
|
Posted: Tue Nov 06, 2007 12:39 am Post subject: |
|
|
V/abs(V->Q
In response to XP's first thing in his post above mine. _________________ I am teh uber pwnage. |
|
| Back to top |
|
 |
|
|
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
|
|