Adopt-an-Example-Program proposal

Here you can link to screenshots and demos etc. of programs made using BBC BASIC
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

KenDown wrote: Fri 20 Jan 2023, 19:48 The brief was to provide explanatory REMs in the program, not to rewrite it
I'm not for a moment suggesting you rewrite it (even adding explanatory REMs is entirely up to you) but I don't want you to think it's an example of how code should be written. Indeed none of the example programs can claim to be that, because both the language and the libraries have evolved since the majority of them were written, and there may be better/easier ways to do things now.

All I can really claim is that the example programs cover a wide spectrum of different approaches to making code do what you want.
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: Adopt-an-Example-Program proposal

Post by KenDown »

Incidentally, you made this challenge, but you haven't said what we should do with a program that we have "adopted"? List it here so that you can decide whether it is worth including in future releases? Send it to you privately? What?
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

KenDown wrote: Sat 21 Jan 2023, 20:23 Incidentally, you made this challenge, but you haven't said what we should do with a program that we have "adopted"?
Nothing, as far as I am concerned. Obviously in a circumstance when the person who has 'adopted' an example program finds a bug in it, or feels that a worthwhile improvement can be achieved, consideration could be given to changing the program distributed with BB4W or BBCSDL. But that's secondary to the object of the exercise.
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

Hated Moron wrote: Mon 16 Jan 2023, 17:57 We badly need to find a way to broaden the knowledge base, so that there are more people who can give advice on some of the more complex uses of BBC BASIC.
There have been fewer queries about how the example programs work than I expected, so either people feel they have a good understanding without any further explanation being needed (good!) or some of the non-trivial example programs haven't yet been 'adopted' by anybody (bad!).
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

Did anybody choose to 'adopt' one of the physics simulations (bbclock, cradle, crates, dangle, dunebuggy, lotto, pinball, pintograph or trebuchet)? It would be very helpful if somebody did, because they may be able to give some guidance in respect of the recent enquiry about how to write these kinds of programs.

It's scary (although not surprising, given my circumstances) how much I have forgotten about those that I wrote myself - which is the majority - so spreading knowledge among a wider range of BBC BASIC users is really going to be essential if this kind of skill isn't going to die out altogether.
svein
Posts: 58
Joined: Tue 03 Apr 2018, 19:34

Re: Adopt-an-Example-Program proposal

Post by svein »

Sadly i remember very little about how i wrote the pintograph program.

But i see in the code and the library that the variables in f.ex. FN_b2KinematicBody(myWorld%%, 8, 51, 0, 0, 0, S1, 0, 0) are transferred to a structure with meaningful names.

It should not be too hard to experiment with the variable values to figure out what does what.

Svein
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

svein wrote: Sat 25 Feb 2023, 10:35 It should not be too hard to experiment with the variable values to figure out what does what.
I suspect what would be most valuable is a guide to relating the functions in box2dlib.bbc with the native Box2D functions, which will be referred to in its own documentation.

As I recall there's not a one-to-one correspondence because there are so many native functions that I wanted to combine them into more manageable (although no doubt slightly less flexible) 'higher level' units.

For example FN_b2StaticBox() calls `b2CreateBody`, `b2PolygonShape`, `b2SetAsBox` and `b2CreateFixtureFromShape` making it considerably more understandable than had it been necessary to call each of those individually from user BASIC code.
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

May I please have an update on this? As far as I'm aware there have so far only been three 'takers' who have made themselves known: Kendall Down agreed to adopt the Jigsaw Puzzle program, Svein the Box2D utilities and DDRM the Direct3D examples.

There are many other supplied example programs which use 'interesting' and perhaps 'non-obvious' techniques which I worry could be forgotten altogether (or not understood) when I can no longer contribute.

I would encourage other members to choose a non-trivial example program that they are interested in and study the code. Feel free to ask here if there's anything requiring explanation (that's very much the point).
KenDown
Posts: 327
Joined: Wed 04 Apr 2018, 06:36

Re: Adopt-an-Example-Program proposal

Post by KenDown »

I should point out that I started to dissect the jigsaw program and extensively REM it, under the impression that when finished, I would submit my work to Richard, who would vet it and then issue the REMed program with BBC SDL. When I discovered that that was not the case, I abandoned the task. I am not in the first flush of youth and even if I came to know and understand the program inside out, my expertise (even if anyone knew to contact me) would be available for a few years at best.

A shame, as there are several programs with features I would find extremely useful if only I could understand their logic and having extensive REMs incorporated would be a great idea.
Hated Moron

Re: Adopt-an-Example-Program proposal

Post by Hated Moron »

KenDown wrote: Mon 12 Jun 2023, 06:54 I should point out that I started to dissect the jigsaw program and extensively REM it, under the impression that when finished, I would submit my work to Richard, who would vet it and then issue the REMed program with BBC SDL.
The process you describe is all your own invention. There was never any question of me "vetting" any programs, what does that even mean? Indeed the object of the exercise was to free me from responsibility, not give me extra work!

It was entirely your choice to add REMs, I never asked for it (I didn't, nor would I wish to, specify any particular process); it's a perfectly good way of recording notes about how the code works. but others may wish to trust their own memory or use another approach.
I abandoned the task. I am not in the first flush of youth and even if I came to know and understand the program inside out, my expertise (even if anyone knew to contact me) would be available for a few years at best.
A "few years" is a lot longer than I will be able to provide support! It sounds to me that you got to the point of regretting your offer and rather than simply saying that you had changed your mind came up with a convoluted excuse that managed to blame me for your own change of heart.

So that means only two takers. :(