Author Topic: I need help optimizing  (Read 4628 times)

0 Members and 1 Guest are viewing this topic.

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
I need help optimizing
« on: November 23, 2011, 02:19:37 am »
Umm this is probably going to take a while but I need someone to help optimize this (attachement below) thank you
This used to contain a signature.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: I need help optimizing
« Reply #1 on: November 23, 2011, 07:03:35 am »
any chance you can post the code as text?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: I need help optimizing
« Reply #2 on: November 23, 2011, 07:57:30 am »
Let me go ahead and do that for him. Just so you know, Kerm's SourceCoder is great for pulling apart .8xp files that were written in the BASIC editor: http://www.cemetech.net/projects/basicelite/sourcecoder2.php

Unfortunately, I know next to nothing about Axe so I can't really help any more than this.

Code: [Select]
:.MARIO
:0→Q
:48→R
:88→N
:0→V
:0→L
:Lbl SAT
:1→T
:If (L=4)
:Text(25,25,"WIN"
:Goto END
:End
:ClrDraw
:Full
:0→Z
:0→H
:0→A
:0→I
:0→J
:0→P
:48→Y
:0→X
:88→D
:48→G
:[FFFFFFFFFFFF427E]→Pic6
:[F789898E89D1A1FF]→Pic5
:[3C7EDBDBFF246699]→Pic4
:[7E81A58181A5817E]→Pic3
:[1C3F3442247E2436]→Pic2
:[7E99A5858981897E]→Pic1
:Pt-On(X,Y,Pic2
:Pt-On(Q,40,Pic1)
:Pt-On(R,40,Pic1
:Pt-On(N,40,Pic1
:Pt-On(D,G,Pic4
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:DispGraph
:Lbl MOV
:If getKey(54)
:1→J
:Pt-On(X,Y,Pic2
:pxl-Test(X,Y-1)→T
:If (T=0)
:For(A,0,20)
:0→J
:If getKey(3)
:X+1→X
:Q-1→Q
:R-1→R
:N-1→N
:Z-1→Z
:If (Z=‾8)
:0→Z
:End
:End
:If getKey(2)
:Q+1→Q
:R+1→R
:N+1→N
:Z+1→Z
:X-1→X
:If (Z=88)
:0→Z
:End
:End
:If (X=D) and (Y≠G)
:65→G
:End
:ClrDraw
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:Y-1→Y
:Pt-On(X,Y,Pic2
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:If I=0
:Pt-On(N,40,Pic1
:Else
:Pt-On(N,40,Pic3
:End
:If P=0
:Pt-On(Q,40,Pic1
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:End
:ClrDraw
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:End
:End
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:If I=0
:Pt-On(N,40,Pic1
:Else
:Pt-On(N,40,Pic3
:End
:DispGraph
:Pt-On(X,Y,Pic2
:If P=0
:Pt-On(Q,40,Pic1)
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:If (X=N) and getKey(54)
:1→I
:End
:If (X=Q) and getKey(54)
:1→P
:End
:If (X=R) and getKey(54)
:1→A
:End
:ClrDraw
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:D-1→D
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:Pt-On(X,Y,Pic2
:DispGraph
:If A=0
:Pt-On(R,40,Pic1
:DispGraph
:Else
:Pt-On(R,40,Pic3
:DispGraph
:End
:If I=0
:Pt-On(N,40,Pic1
:DispGraph
:Else
:Pt-On(N,40,Pic3
:DispGraph
:End
:If P=0
:Pt-On(Q,40,Pic1
:DispGraph
:Else
:Pt-On(Q,40,Pic3
:DispGraph
:End
:DispGraph
:pxl-Test(X,Y+8)→T
:While (T=0) and (J=1)
:If pxl-Test(D,G-1)→V
:If (V=1)
:65→G
:End
:End
:If getKey(3)
:X+1→X
:Q-1→Q
:R-1→R
:N-1→N
:Z-1→Z
:If (Z=‾8)
:0→Z
:End
:End
:If getKey(2)
:X-1→X
:End
:ClrDraw
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:Y+1→Y
:Pt-On(X,Y,Pic2
:Pt-On(D,G,Pic4
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:If (I=0)
:Pt-On(N,40,Pic1
:Else
:Pt-On(N,40,Pic3
:End
:If (P=0)
:Pt-On(Q,40,Pic1
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:End
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:If I=0
:Pt-On(N,40,Pic1
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:D-1→D
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:D-1→D
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:If P=0
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:End
:DispGraph
:Pt-On(X,Y,Pic2
:DispGraph
:End
:0→J
:If getKey(3)
:If (X>80) and (L=0)
:40→Q
:48→R
:56→N
:1→L
:Goto SAT
:End
:If (X>80) and (L=1)
:0→Q
:8→R
:16→N
:2→L
:Goto SAT
:End
:If (X>80) and (L=2)
:72→Q
:80→R
:88→N
:3→L
:Goto SAT
:End
:If (X>80) and (L=3)
:20→Q
:40→R
:80→N
:4→L
:Goto SAT
:End
:ClrDraw
:Q-1→Q
:R-1→R
:N-1→N
:If (Q=‾8)
:88→Q
:End
:If (R=‾8)
:88→R
:End
:If (N=‾8)
:88→N
:End
:Z-1→Z
:If (Z=‾8)
:0→Z
:End
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+64,56,Pic5
:Pt-On(Z+72,56,Pic5
:Pt-On(Z+80,56,Pic5
:Pt-On(Z+88,56,Pic5
:DispGraph
:X+1→X
:While (Y≠48) and (X≠Q) and (X≠R) and (X≠N)
:ClrDraw
:Y+1→Y
:Pt-On(X,Y,Pic2
:DispGraph
:End
:Pt-On(X,Y,Pic2)
:D-1→D
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:If I=0
:Pt-On(N,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:Pt-On(X,Y,Pic2
:End
:DispGraph
:If P=0
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:End
:Pt-On(X,Y,Pic2
:End
:DispGraph
:If getKey(2)
:Q+1→Q
:R+1→R
:N+1→N
:If (Q=96)
:88→Q
:End
:If (R=96)
:88→R
:End
:If (N=96)
:88→N
:End
:X-1→X
:While (Y≠48) and (X≠Q) and (X≠R) and (X≠N)
:ClrDraw
:Y+1→Y
:Pt-On(X,Y,Pic2
:DispGraph
:End
:ClrDraw
:Z+1→Z
:If (Z=88)
:0→Z
:End
:Pt-On(Z,56,Pic5
:Pt-On(Z+8,56,Pic5
:Pt-On(Z+16,56,Pic5
:Pt-On(Z+24,56,Pic5
:Pt-On(Z+32,56,Pic5
:Pt-On(Z+40,56,Pic5
:Pt-On(Z+48,56,Pic5
:Pt-On(Z+56,56,Pic5
:Pt-On(Z+62,56,Pic5
:Pt-On(Z+70,56,Pic5
:Pt-On(Z+78,56,Pic5
:Pt-On(Z+86,56,Pic5
:DispGraph
:Pt-On(X,Y,Pic2)
:D-1→D
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:If A=0
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:If I=0
:Pt-On(N,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:Pt-On(X,Y,Pic2
:End
:Pt-On(X,Y,Pic2
:DispGraph
:If P=0
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:DispGraph
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:DispGraph
:End
:Pt-On(X,Y,Pic2
:DispGraph
:End
:If H=1
:Goto END
:End
:If getKey(15)
:Goto END
:End
:If getKey(55)
:Goto SAT
:End
:Goto MOV
:If (L=4)
:Text(5,5,"WIN"
:Pause 1000
:Goto END
:End
:Lbl END
Generated by [url=http://sc.cemetech.net]SourceCoder[/url], © 2005-2011 [url=http://www.cemetech.net]Cemetech[/url]
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: I need help optimizing
« Reply #3 on: November 23, 2011, 10:06:55 am »
Heres some optimizations:

I took off nearly 100 lines mostly from using a subroutine.
There's probably some other people who can optimize more.

It seems like there's also alot of repeating stuff.
I don't know how your code works but if the exact same thing repeats a whole bunch you should try to add subs.

Code: [Select]
:.MARIO
:0→Q→V→L
:48→R
:88→N
:Lbl SAT
:1→T
:If (L=4)
:Text(25,25,"WIN"
:Goto END
:End
:ClrDraw
:Full
:0→Z→H→A→I→J→P→X
:48→Y→G
:88→D
:[FFFFFFFFFFFF427E]→Pic6
:[F789898E89D1A1FF]→Pic5
:[3C7EDBDBFF246699]→Pic4
:[7E81A58181A5817E]→Pic3
:[1C3F3442247E2436]→Pic2
:[7E99A5858981897E]→Pic1
:Pt-On(X,Y,Pic2
:Pt-On(Q,40,Pic1)
:Pt-On(R,40,Pic1
:Pt-On(N,40,Pic1
:Pt-On(D,G,Pic4
:sub(ABCD)
:DispGraph
:Lbl MOV
:If getKey(54)
:1→J
:Pt-On(X,Y,Pic2
:pxl-Test(X,Y-1)→T
:If (T=0)
:For(A,0,20)
:0→J
:If getKey(3)
:X++
:Q--
:R--
:N--
:Z--
:If (Z=‾8)
:-1→Z
:End
:End
:If getKey(2)
:Q++
:R++
:N++
:Z++
:X--
:If (Z=88)
:-1→Z
:End
:End
:If (X=D) and (Y≠G)
:65→G
:End
:ClrDraw
:sub(ABCD)
:Y--
:Pt-On(X,Y,Pic2
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:!If I
:Pt-On(N,40,Pic1
:Else
:Pt-On(N,40,Pic3
:End
:!If P
:Pt-On(Q,40,Pic1
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:End
:ClrDraw
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:sub(ABCD)
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:End
:End
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:!If I
:Pt-On(N,40,Pic1
:Else
:Pt-On(N,40,Pic3
:End
:DispGraph
:Pt-On(X,Y,Pic2
:!If P
:Pt-On(Q,40,Pic1)
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:If (X=N) and getKey(54)
:1→I
:End
:If (X=Q) and getKey(54)
:1→P
:End
:If (X=R) and getKey(54)
:1→A
:End
:ClrDraw
:sub(ABCD)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:Pt-On(X,Y,Pic2
:DispGraph
:!If A
:Pt-On(R,40,Pic1
:DispGraph
:Else
:Pt-On(R,40,Pic3
:DispGraph
:End
:!If I
:Pt-On(N,40,Pic1
:DispGraph
:Else
:Pt-On(N,40,Pic3
:DispGraph
:End
:!If P
:Pt-On(Q,40,Pic1
:DispGraph
:Else
:Pt-On(Q,40,Pic3
:DispGraph
:End
:DispGraph
:pxl-Test(X,Y+8)→T
:While (T=0) and (J=1)
:If pxl-Test(D,G-1)→V
:If (V=1)
:65→G
:End
:End
:If getKey(3)
:X++
:Q--
:R--
:N--
:Z--
:If (Z=‾8)
:-1→Z
:End
:End
:If getKey(2)
:X--
:End
:ClrDraw
:sub(ABCD)
:Y++
:Pt-On(X,Y,Pic2
:Pt-On(D,G,Pic4
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:!If I
:Pt-On(N,40,Pic1
:Else
:Pt-On(N,40,Pic3
:End
:!If P
:Pt-On(Q,40,Pic1
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:End
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:If I=0
:Pt-On(N,40,Pic1
:sub(ABCD)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:I!f P
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:End
:DispGraph
:Pt-On(X,Y,Pic2
:DispGraph
:End
:0→J
:If getKey(3)
:If (X>80) and (L=0)
:40→Q
:48→R
:56→N
:1→L
:Goto SAT
:End
:If (X>80) and (L=1)
:0→Q+2→L
:8→R
:16→N
:Goto SAT
:End
:If (X>80) and (L=2)
:72→Q
:80→R
:88→N
:3→L
:Goto SAT
:End
:If (X>80) and (L=3)
:20→Q
:40→R
:80→N
:4→L
:Goto SAT
:End
:ClrDraw
:Q--
:R--
:N--
:If (Q=‾8)
:88→Q
:End
:If (R=‾8)
:88→R
:End
:If (N=‾8)
:88→N
:End
:Z--
:If (Z=‾8)
:0→Z
:End
:Pt-On(Z,56,Pic5
:sub(ABCD)
:DispGraph
:X++
:While (Y≠48) and (X≠Q) and (X≠R) and (X≠N)
:ClrDraw
:Y++
:Pt-On(X,Y,Pic2
:DispGraph
:End
:Pt-On(X,Y,Pic2)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:!If I
:Pt-On(N,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:Pt-On(X,Y,Pic2
:End
:DispGraph
:!If P
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:End
:Pt-On(X,Y,Pic2
:End
:DispGraph
:If getKey(2)
:Q++
:R++
:N++
:If (Q=96)
:88→Q
:End
:If (R=96)
:88→R
:End
:If (N=96)
:88→N
:End
:X--
:While (Y≠48) and (X≠Q) and (X≠R) and (X≠N)
:ClrDraw
:Y++
:Pt-On(X,Y,Pic2
:DispGraph
:End
:ClrDraw
:Z++
:If (Z=88)
:0→Z
:End
:sub(ABCD)
:DispGraph
:Pt-On(X,Y,Pic2)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:!If I
:Pt-On(N,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:Pt-On(X,Y,Pic2
:End
:Pt-On(X,Y,Pic2
:DispGraph
:!If P
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:DispGraph
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:DispGraph
:End
:Pt-On(X,Y,Pic2
:DispGraph
:End
:If H=1
:Goto END
:End
:If getKey(15)
:Goto END
:End
:If getKey(55)
:Goto SAT
:End
:Goto MOV
:If (L=4)
:Text(5,5,"WIN"
:Pause 1000
:Goto END
:End
:Lbl ABCD
:For(P,0,11)
:Pt-On(P*8+Z,56,Pic5
:End
:Return
:Lbl END
« Last Edit: November 23, 2011, 10:42:47 am by epic7 »

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: I need help optimizing
« Reply #4 on: November 23, 2011, 05:34:41 pm »
thank you Ill put that in in a sec
This used to contain a signature.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: I need help optimizing
« Reply #5 on: November 23, 2011, 05:39:36 pm »
make sure to backup first. I optimized the hell out of some programs just to discover the opts broke the program. So either first backup your file or put this in another file.
I'm not a nerd but I pretend:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: I need help optimizing
« Reply #6 on: November 23, 2011, 05:42:25 pm »
Its backed up on the page right here :P

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: I need help optimizing
« Reply #7 on: November 23, 2011, 05:43:37 pm »
Oh, my.
I'm not that awake any more. HAHAHA...
I'm now in a LOL state.
I'm not a nerd but I pretend:

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: I need help optimizing
« Reply #8 on: November 23, 2011, 08:59:12 pm »
Code: [Select]
:.MARIO
:0→Q→V→L
:48→R
:88→N
:Lbl SAT
:1→T
:If (L=4)
:Text(25,,"WIN")
:Goto END
:End
:ClrDraw
:Full
:0→Z→H→A→I→J→P→X
:48→Y→G
:88→D
:[FFFFFFFFFFFF427E]→Pic6
:[F789898E89D1A1FF]→Pic5
:[3C7EDBDBFF246699]→Pic4
:[7E81A58181A5817E]→Pic3
:[1C3F3442247E2436]→Pic2
:[7E99A5858981897E]→Pic1
:Pt-On(X,Y,Pic2)
:Pt-On(Q,40,Pic1)
:Pt-On(R,40,Pic1)
:Pt-On(N,40,Pic1)
:Pt-On(D,G,Pic4)
:sub(ABCD)
:DispGraph
:Lbl MOV
:If getKey(54)
:1→J
:Pt-On(X,Y,Pic2)
:pxl-Test(X,Y-1)→T
:!If T
:For(A,0,20)
:0→J
:If getKey(3)
:X++
:Q--
:R--
:N--
:Z--
:If (Z=‾8)
:-1→Z
:End
:End
:If getKey(2)
:Q++
:R++
:N++
:Z++
:X--
:If (Z=88)
:-1→Z
:End
:End
:If X=D + (Y≠G)
:65→G
:End
:ClrDraw
:sub(ABCD)
:Pt-On(X,Y--,Pic2)
:DispGraph
:If X=D
:If Y=G
:→H
:End
:End
:!If A
:Pt-On(R,40,Pic1)
:Else
:Pt-On(R,40,Pic3)
:End
:!If I
:Pt-On(N,40,Pic1)
:Else
:Pt-On(N,40,Pic3)
:End
:!If P
:Pt-On(Q,40,Pic1)
:Else
:Pt-On(Q,40,Pic3)
:End
:DispGraph
:End
:ClrDraw
:Pt-On(D,G,Pic4)
:Pt-On(X,Y,Pic2)
:sub(ABCD)
:If X=D
:If Y=G
:→H
:End
:End
:DispGraph
:End
:End
:!If A
:Pt-On(R,40,Pic1)
:Else
:Pt-On(R,40,Pic3)
:End
:DispGraph
:!If I
:Pt-On(N,40,Pic1)
:Else
:Pt-On(N,40,Pic3)
:End
:DispGraph
:Pt-On(X,Y,Pic2
:!If P
:Pt-On(Q,40,Pic1)
:Else
:Pt-On(Q,40,Pic3
:End
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:If getKey(54)
:If X=N
:1→I
:End
:If X=Q
:1→P
:End
:If X=R
:1→A
:End
:End
:ClrDraw
:sub(ABCD)
:D--
:Pt-On(D,G,Pic4)
:Pt-On(X,Y,Pic2)
:If X=D
:If Y=G
:→H
:End
:End
:Pt-On(X,Y,Pic2)
:DispGraph
:!If A
:Pt-On(R,40,Pic1)
:DispGraph
:Else
:Pt-On(R,40,Pic3)
:DispGraph
:End
:!If I
:Pt-On(N,40,Pic1)
:DispGraph
:Else
:Pt-On(N,40,Pic3)
:DispGraph
:End
:!If P
:Pt-On(Q,40,Pic1
:DispGraph
:Else
:Pt-On(Q,40,Pic3
:DispGraph
:End
:DispGraph
:pxl-Test(X,Y+8)→T
:While (T=0) and (J=1)
:If pxl-Test(D,G-1)→V
:!If V-1
:65→G
:End
:End
:If getKey(3)
:X++
:Q--
:R--
:N--
:Z--
:If (Z=‾8)
:-1→Z
:End
:End
:If getKey(2)
:X--
:End
:ClrDraw
:sub(ABCD)
:Y++
:Pt-On(X,Y,Pic2)
:Pt-On(D,G,Pic4)
:!If A
:Pt-On(R,40,Pic1)
:Else
:Pt-On(R,40,Pic3)
:End
:!If I
:Pt-On(N,40,Pic1)
:Else
:Pt-On(N,40,Pic3)
:End
:!If P
:Pt-On(Q,40,Pic1)
:Else
:Pt-On(Q,40,Pic3)
:End
:DispGraph
:If X=D
:If Y=G
:1→H
:End
:End
:End
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:!If A
:Pt-On(R,40,Pic1)
:Else
:Pt-On(R,40,Pic3)
:End
:If I=0
:Pt-On(N,40,Pic1
:sub(ABCD)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:DispGraph
:!If A
:Pt-On(R,40,Pic1)
:Else
:Pt-On(R,40,Pic3)
:End
:DispGraph
:I!f P
:Pt-On(Q,40,Pic1)
:Pt-On(X,Y,Pic2)
:Else
:Pt-On(Q,40,Pic3)
:Pt-On(X,Y,Pic2)
:End
:DispGraph
:Pt-On(X,Y,Pic2)
:DispGraph
:End
:0→J
:If getKey(3)
:If (X>80) and (L=0)
:40→Q
:48→R
:56→N
:1→L
:Goto SAT
:End
:If (X>80) and (L=1)
:0→Q+2→L
:8→R
:16→N
:Goto SAT
:End
:If (X>80) and (L=2)
:72→Q
:80→R
:88→N
:3→L
:Goto SAT
:End
:If (X>80) and (L=3)
:20→Q
:40→R
:80→N
:4→L
:Goto SAT
:End
:ClrDraw
:Q--
:R--
:N--
:If (Q=‾8)
:88→Q
:End
:If (R=‾8)
:88→R
:End
:If (N=‾8)
:88→N
:End
:Z--
:If (Z=‾8)
:0→Z
:End
:Pt-On(Z,56,Pic5
:sub(ABCD)
:DispGraph
:X++
:While (Y≠48) and (X≠Q) and (X≠R) and (X≠N)
:ClrDraw
:Y++
:Pt-On(X,Y,Pic2
:DispGraph
:End
:Pt-On(X,Y,Pic2)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:→H
:End
:End
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:DispGraph
:!If I
:Pt-On(N,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:Pt-On(X,Y,Pic2
:End
:DispGraph
:!If P
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:End
:Pt-On(X,Y,Pic2
:End
:DispGraph
:If getKey(2)
:Q++
:R++
:N++
:If (Q=96)
:88→Q
:End
:If (R=96)
:88→R
:End
:If (N=96)
:88→N
:End
:X--
:While (Y≠48) and (X≠Q) and (X≠R) and (X≠N)
:ClrDraw
:Y++
:Pt-On(X,Y,Pic2
:DispGraph
:End
:ClrDraw
:Z++
:If (Z=88)
:0→Z
:End
:sub(ABCD)
:DispGraph
:Pt-On(X,Y,Pic2)
:D--
:Pt-On(D,G,Pic4
:Pt-On(X,Y,Pic2
:If X=D
:If Y=G
:1→H
:End
:End
:!If A
:Pt-On(R,40,Pic1
:Else
:Pt-On(R,40,Pic3
:End
:!If I
:Pt-On(N,40,Pic1
:Pt-On(X,Y,Pic2
:Else
:Pt-On(N,40,Pic3
:Pt-On(X,Y,Pic2
:End
:Pt-On(X,Y,Pic2
:DispGraph
:!If P
:Pt-On(Q,40,Pic1
:Pt-On(X,Y,Pic2
:DispGraph
:Else
:Pt-On(Q,40,Pic3
:Pt-On(X,Y,Pic2
:DispGraph
:End
:Pt-On(X,Y,Pic2
:DispGraph
:End
:If H=1
:Goto END
:End
:If getKey(15)
:Goto END
:End
:If getKey(55)
:Goto SAT
:End
:Goto MOV
:If (L=4)
:Text(5,5,"WIN"
:Pause 1000
:Goto END
:End
:Lbl ABCD
:For(P,0,11)
:Pt-On(P*8+Z,56,Pic5
:End
:Return
:Lbl END


Please take no offense, but i have never seen such unoptimized code.
Does your game look glitchy around some sprites when you play it?
You can save over 100 bytes by reworking DispGraphs.
« Last Edit: November 23, 2011, 09:00:00 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: I need help optimizing
« Reply #9 on: November 23, 2011, 11:19:02 pm »
XP

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: I need help optimizing
« Reply #10 on: November 24, 2011, 01:42:27 pm »
lol, so I ran this program on Wabbitemu, and it crashed it the moment I tried to jump! lol I wonder what happened :w00t:
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES: