Jump to content
IGNORED

BASIC 10 Liner Contest 2021


carlsson

Recommended Posts

It looks like the BASIC I'm using having the brackets inbetween the Exponent Operator is required.

 

When I simplify the equation RND<0.5 can either be 0 or -1, so what happens is:

 

-1^(0) =-1

-1^(1)=-1

-1^0=-1

-1^-1=-1

 

In theory when I do:

(-1)^0 = 1

(-1)^-1= -1

 

though BASIC doesn't won't accept (-1)^RND<0.5 maybe because it thinks that along with the Exponent Operator a value is excepted, but without any brackets the computer won't simplify it into a meaningful value, I think this is the reason why it'll only accept brackets around all values and do the Exponent calculation last.

Link to comment
Share on other sites

3 hours ago, AMSDOS said:

though BASIC doesn't won't accept (-1)^RND<0.5 maybe because it thinks that along with the Exponent Operator a value is excepted, but without any brackets the computer won't simplify it into a meaningful value, I think this is the reason why it'll only accept brackets around all values and do the Exponent calculation last.

You need the brackets around -1 because it seems that your parser gives the unary minus a lower precedence than the exponentiation.

 

You need the brackets arround the exponent because the comparisson symbol has the lowest precedence in the expression, and it behaves like [(-1)^RND]<[0.5].

 

BTW, which BASIC is that?

 

Link to comment
Share on other sites

AMSDOS is working on the Amstrad CPC so that would be Locomotive BASIC.

 

I made some brief testing yesterday and found that every Microsoft based version of BASIC (e.g. Commodore, Oric, MSX) has a lower precedence on unary minus than exponent. A few of the systems I tried (e.g. ZX Spectrum), I couldn't get it to work at all. Perhaps a cheat sheet would come handy, something I begun a little while ago but haven't finished. The fact that unary minus would be handled before exponent like on the Atari seems a little unique actually. I suppose one would have to go back to Dartmouth or some ANSI spec to tell what is the intended order of operations.

 

 

  • Like 1
Link to comment
Share on other sites

I just applied the laws I learned from Math and used BOMDAS (Brackets Of Multiplication, Division, Addition, Subtraction), so anything with a Bracket around it is given precidence and problems calculated within those 1st based on the Multiplication, Division, Addition & Subtraction. The -1 to me suggests that needs to be carried out last based on subtracting 1, though in this case the Computer has to handle something called RND<0.5 and I think the computer can only read from left to right to define the answer, so only when brackets are around the RND, the computer determines that has higher presidence and find a solution and with '-1' being in the brackets it forces the exponent to me done last and because RND<0.5 can shift between 0 and -1, (-1)^(0) returns 1 and (-1)^(-1) returns -1.

Link to comment
Share on other sites

Also I learned that the Comx-35 BASIC doesn't seem to like A=(RND<0.5) or PRINT 1=2 at all. Basically you can do IF A<10 comparisons, but you can't assign, print or otherwise use those as truth values, or otherwise I'm doing something terribly wrong. Pretty much every other BASIC that I've tried (*) at least has some ability in this field.

 

Edit: BBC Basic lets unary minus have precedence over exponent, so Atari is not alone here (though perhaps that is how it is supposed to be, and everyone else including Microsoft is doing it wrong)

 

Edit 2: On Hector HRX using BASIC III, the command RND(n,m) generates a floating point number in that range so it would become A=(-1)^(RND(0,1)<0.5). I'm not sure which school this dialect origins from.

 

(*) I've got emulators installed for at least Amstrad CPC, Apple II, Atari 8-bit, BBC Micro, Colour Genie, Commodore 8-bit (entire series), Comx-35 and some Elf/Vip variants, Enterprise, Hector/Victor, MSX1 & MSX2, Mattel Aquarius, Oric, TI-99/4A (TI BASIC and Extended BASIC), Tandy MC-10, VTech Laser 1xx/2xx (VZ), Laser 500/700, ZX-81 and ZX Spectrum. I realize I'm missing out on some of the lesser systems but got a good deal of coverage when it comes to different BASIC dialects, both Microsoft based and the standalone ones.

Edited by carlsson
  • Like 1
Link to comment
Share on other sites

My extrem256 hit a creative roadblock so I thought I'd do a pur80 to cleanse the palette but it got a little out of hand and now is going to be my extrem256.

 

Here's a little alpha sneak peak:

 

 

My other extrem256 is graphically more impressive but not as much fun to code.

  • Like 14
Link to comment
Share on other sites

16 minutes ago, Preppie said:

Movie isn't playing :(

Sorry, I tried uploading as an animated GIF, but it would take it, then I uploaded the '.mov', but then I unloaded it thinking nobody would be able to see it. I sent the game in to the organiser yesterday, but I'm having second thoughts about how my character moves along, I've since written a simple example of moving objects along and having them appear in the bottom window, which is how this game is meant to operate, but as the video shows, the bottom walls are updated 1st, followed by the top. So might have some time to fix this.

Link to comment
Share on other sites

I finally got my entry squished down into ten lines and all the bugs out. As with Eric above, I’m documenting it and polishing it up for release, but here’s a sneak peak of me playing Golf on Mount Fuji (minus the audio, that’s a treat that’ll have to wait for the released version).

 

I’m really enjoying the Sublime Text > MacTurban > basicParser workflow, and now with my real 130XE and Fujinet I can easily TNFS mount and test my game right on real hardware too. Boom!

 

Thus, in true standing-on-the-shoulders-of-giants fashion, I humbly thank @dmsc, @skr, @mozzwald, @tschak909 (plus anyone I’ve forgotten) for making this fun and easy.

Screen Shot 2021-03-18 at 00.01.26.png

  • Like 6
  • Thanks 4
Link to comment
Share on other sites

2 hours ago, Preppie said:

Vic must be a little shy today, so here's a link to his latest masterpiece:

 

 

Ha, ha, ha... I made that video public when I sent the entry to @Bunsenjust before going out.

 

The entry info is:

 

Name: The Children

Category: EXTREM-256

Language: FastBasic 4.5.2

 

It has lots of zones, more than the 7 ones from the video, but I don't want to spoil them.

 

  • Like 2
Link to comment
Share on other sites

50 minutes ago, erichenneke said:

That's how I felt about my "Hubbub" from 2 years ago too!   :)

I did very bad in your game... I couldn't score too much AFAIR... lots of fails in a run. I'm waiting to try Purge, it seems that the dynamics are different from what I imagined from the video.

 

I have a prototype for a mini Q*Bert with bitmaps and P/M players. I wrote it for the PUR-120 category, but I went out of space, and I didn't want to submit another cloned game in the EXTREM-256 category so I took the kernel and fit it in PUR-80... Hubert was the result. I might rework the prototype if I have the motivation for next year's contest.

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, carlsson said:

Hm. Given that machine code in general is not allowed, is there anything said about setting up custom DLI with machine code? Perhaps people on other systems do similar tricks to get certain effects without a regular SYS/CALL/USR?

The problem isn't with setting up a DL that triggers DLI calls.  That would be okay by the rules. 

 

The problem is that you can only implement the actually interrupt routine itself by using machine code, which you would have to poke into memory, and that would break the rule about "The 10 lines must not contain any machine programs". 

 

Plus I've asked, specifically, if this would be okay to do and I was told no.   :(

 

Link to comment
Share on other sites

I see. In that case, games like the above probably will go into the WILD category instead of EXTREM-256? If there was a vote, I'd allow machine code routines in EXTREM-256, possibly even PUR-120 but then again I understand it is not a matter of a majority decision to alter the rules.

Link to comment
Share on other sites

1 hour ago, carlsson said:

Hm. Given that machine code in general is not allowed, is there anything said about setting up custom DLI with machine code? Perhaps people on other systems do similar tricks to get certain effects without a regular SYS/CALL/USR?

AFAIR, there was one machine that it was allowed to perform a system call because it was the only way to perform some standard operations such as enabling sound and change the graphics mode, but they weren't call to custom code.

 

On the other side, one entry was moved to the WILD category because it didn't include assembly language, but used some cut&paste of code from the OS to build a custom routine.

 

So, the way to go is to make the language do what you want and to provide it with a simple BASIC statement... Fortunately @dmsc is always open to new ideas for FastBasic.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...