[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple lle display
- Subject: Re: Apple lle display
- From: Linards Ticmanis <ticmanis@gmx.de>
- Date: Tue, 05 Apr 2011 17:51:56 +0200
- In-reply-to: <alpine.DEB.2.00.1104051114440.18377@midnightmarauder.localdomain>
- Newsgroups: comp.sys.apple2
- Organization: Arcor
- References: <inch1u$in3$1@dont-email.me> <jdSdnZoa0q72XAfQnZ2dnUVZ5vadnZ2d@giganews.com> <alpine.DEB.2.00.1104051114440.18377@midnightmarauder.localdomain>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8
- Xref: g2news2.google.com comp.sys.apple2:23107
On 04/05/2011 05:17 PM, Steve Nickolas wrote:
> On Tue, 5 Apr 2011, Michael J. Mahon wrote:
>
>> Bettablue wrote:
>>> First, I want to thank all of you who have answered some of my questions.
>>> The results are proving to be working well; especially with the conversion
>>> of IBM BASIC to Apple BASIC. There are some minor differences, like when
>>> randomizing from 1. With MS basic the command has you randomize from 0,
>>> but with Apple BASIC, you actually have to randomize from -1. I haven't
>>> had any problems running most of the MS programs on the Apple though.
>>
>> The +1 argument is only a "mode" argument, telling RND to deliver
>> the next pseudorandom number in the sequence. Any positive number
>> has the same effect. The number returned is always in the range
>> of 0 to 0.999999999 and this range is not changeable.
>
> Usually I never seed the RNG in fpbasic. In GWBASIC/BASICA, one needs to
> RANDOMIZE TIMER first. Otherwise, RND works the same in both dialects.
RND in Applesoft BASIC is very badly implemented, the numbers start
repeating rather quickly. Apple Integer BASIC has a better RND in this
respect. If you need random numbers for more than simple games in
Applesoft, you should write your own pseudo-random routine.
By the way, Applesoft BASIC (the one built into the IIe) is actually a
Microsoft BASIC with a few Apple specific commands added; Apple bought
it from MS for a one time fee I think. It's slightly different from
other MS BASICs such as the one used on the IBM PC, because it's 6502
based, but it's quite similar to e.g. the Commodore 64 BASIC.
It's easy to test if any 6502 BASIC is based on the Microsoft codebase.
Enter the following (nonsense) command:
PRINT ""+-0
MS 6502 BASIC will crash - hang the machine, drop into the built in
monitor, or do other unexpected things. This works on many machines,
including all 8-bit Commodores, the Oric-1, and all Apple II systems
except for the original II. Non-MS BASICs such as Apple Integer BASIC or
the BASIC in the Atari 800XL won't crash but will display a syntax error
(or some other error).
--
Linards Ticmanis