# 10liner basic parallax scrolling

صفحة 2/3
1 | | 3

The game and source are both very lovely. I like this!

https://msxpen.com/codes/-M09ofg1kqfj1kyPXDVW

thegeps wrote:

Explanation is very easy and complete (like a "for dummy") because I had to explain the code to non msx users

Standart RND in MSX Basic is very expensive function by speed

Yep, and sqr too... but in a basic contest you have to use what your basic gives you...

Actualy - no, your code loking like code of good programmers, then you know another ways for doing it faster

Rnd? Really not (probably it is obvious but I can't see it)

You have TIME system variable

Yep, I know, but if I need a number in a range 2-18 I had to do too things and I have a 10line limit, 120 chars for each line, line numbers included. And if I have to divide and/or multiply then where is the speed gain?

thegeps wrote:

Yep, I know, but if I need a number in a range 2-18 I had to do too things and I have a 10line limit, 120 chars for each line, line numbers included. And if I have to divide and/or multiply then where is the speed gain?

X=((TIME and 15)+3)-((TIME and 1)=0)
It's a little longer, but several times faster
Ofc, TIME is not integer, and will give overflow.
But &hFC9E, return BYTE (And FC9F - high byte)

32 chars (after removing unwanted spaces)... very long for a tenliner pure120. Often we have to sacrifice speed to fit code in these contests (but you got a point, it's faster. I can use it sometimes)

It was a little inaccurate in the range, but you get the point

صفحة 2/3
1 | | 3