- CSE program is sorta slow
- 24 May 2015 07:48:07 am
- Last edited by mr womp womp on 13 Jul 2015 02:53:47 pm; edited 9 times in total

okay so I wanted to make an update of my old refraction program in hybrid-basic, because the old one was just ewh, so I did that and well it is working as it should, but it's soooo slow (mostly the input thing), I don't think it's worth uploading to the archives at that speed even though it's much prettier than the one that I currently have up there. I was wondering if anybody could think of ways to make it better/faster? Anyways here's the code for the whole thing

edit: Okay, I fixed the places where there were two branches that converged to the same place, and added all the ends to the if conditions that were lacking one (that I could find) updated the code below too (already looks much better)

edit: Okay, I fixed the places where there were two branches that converged to the same place, and added all the ends to the if conditions that were lacking one (that I could find) updated the code below too (already looks much better)

**Code:**```
:DCS
```

"5255555555555555552555555555555555525555555555555555255555555555555552555555555555555525555555555555555255555555555555552555555588888888828888888888888882888888888888888828888888888888882888888888888888828888888888888882888888888888888828888888888888882888

If 80>det([[20

Then

Disp "Get Doors CSE to run this

Return:End

Degree:Func

DelVar MDelVar LDelVar JDelVar IDelVar V80->N:60->O:80->P:60->Q:60->H:224->T

"01=/02=/n1=/n2=/Crit=->Str2

Lbl 2

DelVar Areal(0,1,1

real(0,3,4,7

real(7,9,0,60,160,60,16

real(7,5,80,0,80,107,31

real(7,7,0,107,160,13,151

real(7,5,80,60,N,O,T

real(7,5,80,60,P,Q,T

real(7,5,80,60,E,H,T

60->H

Str2

real(6,0,3,63,T,47

For(F,1,4

expr(sub("MLIJ",F,1->U

round(U,2->U

8F+55->E

{0,1->L1

{0,U->L2

LinReg(ax+b) {Y1}

Equ>String({Y1},Str0

sub(Str0,1,length(Str0)-3

real(6,0,28,E,T

real(7,5,30F,107,30F,120,151

End

If I>=J:Then

round(V,2->V

{0,1->L1

{0,V->L2

LinReg(ax+b) {Y1}

Equ>String({Y1},Str0

sub(Str0,1,length(Str0)-3

real(6,0,44,95,T

End

If I<J:Then

"none

real(6,0,44,95,T

End

real(7,9,90,2,61,21,8

"REFRACT/Mr.Womp

real(6,0,93,5,13,47

real(6,0,92,4,31,47

real(7,7,90,2,61,21,31

"n1 n2 01

real(6,0,5,110,151

"02 Quit

real(6,0,98,110,151

real(7,5,0,60,160,60,31,1

Repeat max(K={11,12,13,14,15,45

getKey->K

End

If K=15 or K=45:Return

5+4(2(K=12)-(K=13)+(K=11->theta

" ->Str5

real(0,3,4,16

sub(Str2,theta,3

real(6,0,45,50,224

"CLEAR:ERASE/ENTER:LOCK IN

real(6,0,5,99,224,47

real(7,7,2,2,156,116,30

real(7,7,0,0,160,120,30,1

While K!=105

Repeat K=45 or K>71 and min(K!={75,81,85,91,95,104

getKey->K

End

If K=45:Then

" ->Str5

real(7,9,68,50,88,15,16,1

End

If K!=105:Then

sub("789 456 123 0.",K-36-5int(.1K),1->Str3

Str5+Str3->Str5

real(8,1,0

Str5

real(6,0,60,50,224,1

End

End

"LOADING...

real(6,0,36,40,224,1

sub(Str5,2,length(Str5)-1->Str5

expr(Str5->C

If theta=1:Then:C->M

DelVar O80-60tan(M->N

End

If theta=5:Then:C->L

80+60tan(L->P

106->Q

End

If theta=9:C->I

If theta=13:C->J

If IJMV and M>V:Then

DelVar H80+(60sin(M)/sin(90-M->E

Goto 2

End

If IJM:Then

sin^-1(Isin(M)/J->L

80+(60sin(L)/sin(90-L->P

106->Q

End

If IJL:Then

sin^-1(Jsin(L)/I->M

DelVar O80-(60sin(M)/sin(90-M->N

End

If IML

Isin(M)/sin(L->J

If JML

Jsin(L)/sin(M->I

If IJ and I>J

sin^-1(J/I->V

Goto 2