Sv: A83: Random values


[Prev][Next][Index][Thread]

Sv: A83: Random values




THANK YOU!

I'm using your code and it works perfectly (after changing ex hl,de to ex de,hl - I looked it up in the tab)!

The Core code of my first asm-program is now complete. It's a Nibbles clone (remember that QBasic thing?) What now needs to be done is designing levels 2 - ? and perhaps write some nice intro-/outroscreens. After that I may do a little optimizing of the code - however its quite fast - had to put in quite a big delay to slow it down to be playable. (Now _THATS_ something one woulnd't need with ti-basic :-) - and its less than 1500 bytes so.... I think its nice.

If anyone would care to see it and possibly comment on it - let me know. I'll be happy to start "shipping" it..

-----Oprindelig meddelelse-----
Fra: James Matthews <matthews@tkb.att.ne.jp>
Til: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Dato: 11. september 1998 00:59
Emne: Re: A83: Random values


>
>Thomas:
>
>I ENGLISH...that means you could do something like:
>
>call _random
>ld   a,94
>call _setxxop2
>call _fpmult
>call _convop1
>ex  hl,de
>ld   a,64
>call _Setxxop2
>call _fpmult
>call _convop1
>
>This isn't fast (at all...) but it SHOULD work.  You'll now have two random
>numbers in HL and DE.
>
>Later,
>
>James.
>
>
>
>James Matthews (matthews@tkb.att.ne.jp)
>
>ICQ: 7413754
>http://home.att.ne.jp/gold/tomcat21/index.html
>http://library.advanced.org/18242/
>
>----------
>> From: Linus Akesson <lairfight@softhome.net>
>> To: Thomas Turn Jensen <assembly-83@lists.ticalc.org>
>> Subject: Re: A83: Random values
>> Date: Friday, September 11, 1998 5:03 AM
>> 
>> 
>> Random algorithms are quite numerous out there... one idea is to take the
>> previous random number you got, rotate it some, add some, eor some, then
>try
>> the program and see if there's a visible pattern. If there is, change
>some of
>> the constants and try again...
>> 
>> Linus
>> 
>> On 10-Sep-98, Thomas Turn Jensen wrote:
>> >I need to get two random values...
>> >one in the range [0..94] and the other in [1..64] (yes you guesed it -
>it's
>> >for the graph-screen)
>> 
>> >I've found a function called "_Random" but have no idea what parameters
>it
>> >takes where - nor what/where the output is...
>> 
>> >Could someone either explain to me how it works or tell me how to write
>> >something which results in the above mentined numbers. (If i get a
>function
>> >that results in a random byte thats ok - where I need it, speed isn't
>> >essential so I can just check it and if not good generate another random
>> >number)
>> >In case someone gives me some code, _plz_ explain what it does as I'm
>more
>> >interesting in learning how to make it rather than always use other
>peoples
>> >code.
>> 
>> >Thank you.
>> 
>> >***
>> >Thomas Turn Jensen
>> >Icq uin => 8128636
>> >IRC, Undernet => Mukke
>> >***
>> >If your computer gives you trouble
>> >Call for Mukke on the double
>> >***
>> 
>