Author Topic: Slow Down a Program  (Read 4321 times)

0 Members and 1 Guest are viewing this topic.

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Slow Down a Program
« on: February 09, 2014, 11:30:29 pm »
I am a newb at Axe Parser, and was wondering how to slow a program down...  I have already used ExprOff.  What is the best method to do so, without random code that takes up bytes?
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Slow Down a Program
« Reply #1 on: February 09, 2014, 11:38:13 pm »
You could have a meaningless interrupt going on in the background that just increments a counter variable. This has actually never occurred to me before. I wonder why you need to slow down a program, though?
I am Bach.

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Re: Slow Down a Program
« Reply #2 on: February 09, 2014, 11:40:46 pm »
It is a very basic program, and some of the graphics are too hard to see, not to mention the fact that one keypress moves a tank across the screen.  What exactly do you mean with the breaks?  (Like I said, I am a total newb)
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Slow Down a Program
« Reply #3 on: February 09, 2014, 11:49:06 pm »
Breaks? I said interrupts. They are routines that interrupt the execution of a program based on the internal timers, and continue where the program left off.

That said, an easy way is that for the things that move, you multiply the position variable by a number and increment when you increment by a smaller number than the scaler constant. When you display, you just divide the position variable by the scaler constant.

For example:
Code: [Select]
2*5->X
2*5->Y

X+[keypress]->X
Y+[keypress]->Y

Pt-On(X/2,Y/2,[Ptr])
I am Bach.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Slow Down a Program
« Reply #4 on: February 10, 2014, 12:23:50 am »
I would recommend using Pause x. x=1800 corresponds to approximately one second on a calculator running at 6MHz (the default), or x=4500 corresponds to approximately one second on a calculator running at 15MHz (if you've used Full on a 15MHz-capable calculator).
« Last Edit: February 10, 2014, 12:32:48 am by Runer112 »

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Re: Slow Down a Program
« Reply #5 on: February 10, 2014, 12:31:03 am »
Thank you!  That is a great idea...
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Slow Down a Program
« Reply #6 on: February 10, 2014, 12:59:46 am »
Pimath went a little too far on this one :P I hope you're not using imterrupts to slow down a program ... Such a waste.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Slow Down a Program
« Reply #7 on: February 10, 2014, 01:00:52 am »
Matref: see my second post.

No interrupts :P
I am Bach.