### Author Topic: ASCII World  (Read 6969 times)

0 Members and 1 Guest are viewing this topic.

#### chattahippie

• LV6 Super Member (Next: 500)
• Posts: 358
• Rating: +27/-0
• Super Member! :D
##### Re: ASCII World
« Reply #15 on: February 18, 2012, 12:29:15 pm »
For the
Code: [Select]
 U+(θ=26 and U≠16)-(θ=24 and U≠1→U
you can change it to
Code: [Select]
min(16,max(1,U+(θ=26)-(θ=24→U
and likewise for V.

I am not sure if it will go faster, but it is smaller

#### Yeong

• Not a bridge
• LV12 Extreme Poster (Next: 5000)
• Posts: 3739
• Rating: +278/-12
• Survivor of Apocalypse
##### Re: ASCII World
« Reply #16 on: February 18, 2012, 12:30:52 pm »
ah. that's a smart way.
I'll implement it. Thanks
Sig wipe!

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: ASCII World
« Reply #17 on: February 19, 2012, 02:48:21 am »
There doesn't seem to be a bit speed difference, but yeah you save a few bytes.

#### jsj795

• LV9 Veteran (Next: 1337)
• Posts: 1105
• Rating: +84/-3
##### Re: ASCII World
« Reply #18 on: February 19, 2012, 04:04:05 am »

Code: [Select]
::"TOWN CODE:Lbl T1:0→∟ADATA(80:"XXXXXXXXXXXXXXXXX  [OOO]        X [OOOOO]       X  11I11        X  11M11     000X    0       0  X    0       0  X    000000000  →Str1:" 0M→Str2:Output(1,1,Str1:prgmθWALK:If U=16 and θ=26:Then:1→U:Goto T2:End:If V=8 and θ=34:Then:1→V:Goto T3:End:If U=6 and V=5:Then:7→V:8→U:Goto I1:End:Goto T1
Code: [Select]
::"WALKING ENGINE:3→Z:prgmθTRT:Output(V,U,Ans:DelVar θRepeat θ:getKey→θ:End:16V-16+U+16(θ=34 and V≠8)-16(θ=25 and V≠1)+(θ=26 and U≠16)-(θ=24 and U≠1→T:DelVar B:sub(Str1,T,1:If Ans=sub(Str2,1,1) or Ans=sub(Str2,2,1) or Ans=sub(Str2,3,1:Then:U+(θ=26 and U≠16)-(θ=24 and U≠1→U:V+(θ=34 and V≠8)-(θ=25 and V≠1→V:End:If θ=31:prgmθMENU:If θ=45:Then:U→∟ADATA(78:V→∟ADATA(79:ClrHome:AxesOn:FnOn :ZStandard:Stop:End
Code: [Select]
::" PART OF PRGM TRT:If Z=3:Then:"iθπ:sub(Ans,∟ADATA(5)+1,1:End
These are my main loop / walking code.
Can you see any way to make this faster?

First of all, be careful of the Goto within the If:Then:End block, cuz it might cause the memory leak.
Also, after one key-press, it seems to go through the map initialization again in the main loop although there's no need for it.

Try this:

::"TOWN CODE
:Lbl T1
:DelVar E /This is for the event. You can choose whatever variable/
:"XXXXXXXXXXXXXXXXX  [OOO]        X [OOOOO]       X  11I11        X  11M11     000X    0       0  X    0       0  X    000000000  →Str1
:" 0M→Str2
:Output(1,1,Str1
:prgmθWALK
:If U=16 and θ=26:Then:1→U:Goto T2:End
:If V=8 and θ=34:Then:1→V:Goto T3:End
:If U=6 and V=5:Then:7→V:8→U:Goto I1:End

:If E=1:Goto T2
:If E=2:Goto T3
:If E=3:Goto I1

:Goto T1

::"WALKING ENGINE
:Repeat E or max(θ={31, 45
:3→Z:prgmθTRT
:Output(V,U,Ans
:DelVar θRepeat Ans:getKey→θ:End
:16V-16+U+16(θ=34 and V≠8)-16(θ=25 and V≠1)+(θ=26 and U≠16)-(θ=24 and U≠1→T
:DelVar B
:sub(Str1,T,1
:If Ans=sub(Str2,1,1) or Ans=sub(Str2,2,1) or Ans=sub(Str2,3,1
:Then
:min(16,max(1,U+(θ=26)-(θ=24→U
:min(8,max(1,V+(θ=34)-(θ=25→V

:End
:If U=16 and θ=26:1→E
:If V=8 and θ=34:2→E
:If U=6 and V=5:3→E
:End

Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a$1 item he needs.
A woman will pay $1 for a$2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

#### Yeong

• Not a bridge
• LV12 Extreme Poster (Next: 5000)
• Posts: 3739
• Rating: +278/-12
• Survivor of Apocalypse
##### Re: ASCII World
« Reply #19 on: April 05, 2012, 08:46:55 pm »
bump.

Well, I decided to modify this so it can be fit for TI-Concours.

The moving will be different like Riviera style, but the storyline won't change.
Sig wipe!

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55942
• Rating: +3154/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: ASCII World
« Reply #20 on: April 07, 2012, 10:48:13 pm »
Good luck and I can't wait to play it