Cliff Richard Loves Rihanna.... FACT!
-------------------------------------

By Andy Jenkinson (uglifruit) for comp.sys.sinclair Crap Games Competition 2021.

For ZX Spectrums with AY Chips.

I.e. 48K models with an exernal AYchip eg. Melodik AY-3-8192 Soundbox or ZX-AY add-on.

Or, at a pinch, 128K models.

Or normal 48K models, but silently. [except for a sound effect described in FEATURES 2]


In the playground there were two ways of determining whether someone loved someone else.  One of those was demonstrably rubbish (de-petaling flower heads and chanting "She loves me, she loves me not".  This was disproved by Helen Pearce who apparently *didn't* love me, despite all the strategically picked flowers I checked with claiming otherwise.)

The other way used science.  This was when you took the names of the people, and then wrote down the combined number of Ls, Os, Vs, Es and Ss in their names in a long string.  Then - here is where the science comes in - you would add up the adjacent numbers and write the sum below thus creating a new number.  This would be repeated until a number that could be read as a percentage was given showing how much they were in love.

Worked Example:

         ANDREW JENKINSON
  		LOVES
	SARAH MARSHALL
		
				Ls 2
				Os 1
				Vs 0
				Es 2
				Ss 3
		
               2   1   0   2    3
		 3    1   2   5
		   4    3   7
		      7   10
		        8  1
		       
Thus 81%.  FACT!


This scientific method of calculation is implemented within "Cliff Richard Loves Rihanna.... FATCT!" by harnessing 48K of 3.5MHz processing power, in a heady combination of BASIC and super-fast MACHINE CODE.

Not only this, "CRLR...F!"" also allows other relationships to be explored - not just 'love'.  So if you've ever wanted to know how much David Tennant gropes June Whitfield, this is the place to check.  (43%, allegedly).


Unfortunately, some relationships are just too complex for a 48K machine, and no final percentage can be determined.  Your ZX Spectrum personal computer will inform you if this is the case, and I suggest you resort to flower picking methods.

Others relationships can get in a loop, and the ZX Spectrum will tell you of this.  The computer is self-aware enough to spot this happening (just like Joshua in the film War Games) and inform you.  Wouldn't you like a nice game of chess?


FEATURES:
---------

1. AUTO-COMPLETE:  Any prompts can be skipped by just pressing ENTER, and the random names of your favourite celebrities/relationships will be filled in.

2. ADULTS ONLY (18+) MODE:  The auto completed relationships will be safe-for-work, but if you enter a particular word in the 'Relationship' prompt, this will unlock more adult relationships that the computer might randomly select from then on.  The key word is F***S and definitely isn't a word that is known by under 18s.  So us older folks are 100% safe from random rude relationships inadvertently being suggested as happening in front of sweet innocent eyes.  When you type in the special keyword, you'll know you've triggered over 18 adults only mode by the 100% Machine Code sound effect.

3. AY MUSIC MODE:  I spent *a lot* of time writing an interrupt driven AY music driver, that plays AY music in the background, and I'm using it here with an original music composition entitled "Liza Tarbuck Loves Ricky Martin... FACT!".  When you exit to BASIC you'll have to use RANDOMIZE USR 49093 to stop the music.  Because it gets annoying VERY quickly.

4. HACKER FRIENDLY FORCED 48K MODE:  If you break into the program, you will notice that the AY MUSIC continues playing as you hack the program.  This soothing tune will continue indefinitely.  If you chose to use a 128K Spectrum you'll notice that the special loader has forced the computer into USR0 48K mode.  This was just so that you could experience the benefit of hacker friendly forced 48K mode with background music.  (The memory paging means my interrupt Driven Music driver doesn't work when using 128K BASIC)

5. TINY-SCREEN/CRT OPTIMIZED DITHERED COLOUR LOADING SCREEN:  The loading screen uses attributes only across a dithered display to simulate lovely shades of pink.

6. FANCY PANTS INITIAL LOADER:  The initial basic loader is pretty darned snazzy, if I do say so myself.  It has some embedded super-fast machine code in it's REM statements.  The first one forces USR0 mode (And is based upon Slavomir Labsky's work (https://busy.speccy.cz/tvorba/usr0.htm). The other REM statement is a 16 byte checkerboard routine, that sets up the screen so the loading screen only has to load the 768 byte attribute display.  This means that use the utterly fabulous 100% machine code Stipple Art Tool (https://spectrumcomputing.co.uk/entry/35213/ZX-Spectrum/Stipple_ATTR_Art_Tool) to design the loading screen.  [Look, it took me a lot of time and a lot of effort to write that sodding tool so I'll use it and plug it shamelessly, whenever I get the chance.]

7. FANCY PANTS PROPORTIONAL FONT:  I wrote a Proportional Font Routine and a proportional Font Editor (and designed a pretty font), so I'm using it here.  Here I've used a technique I'd not tried before to access it from BASIC.  I've modified it to print the text of the first string variable defined (calculated offset from the System Variable VARS).  Hence my BASIC line 0 which clears any other variables, then defines h$ - which is subsequently modified each time just before the m/code proportional printing routine is called.  Ugly POKES are used to choose where the text appears on the screen.  Being proportional it's really difficult to get it centred on the screen, as you can probably tell.

8. FANCY SCROLLING:  I wrote (from scratch) a routine to pixel scroll some of the screen.  It's good, innit.

9. ANIMATED COLOUR BOX:  I knocked together a m/code routine to draw a 'box' in attributes on the screen.  It's a bit "poke heavy" to set up, but is called repeatedly from BASIC to do the animated box that "zooms in" when a percentage is calculated.

10. UDGs.  Three of the suckers.  Inefficiently defined within the BASIC program itself.  I did consider having them as a separate CODE load, but it seemed a bit daft for just 24 bytes.  They make up the thermometer which is PLOT filled from BASIC when a percentage is found.  I actually quite like that effect.

11. CAPSifying.  I took the time to put every character into upper case in the entered string from BASIC, rather than a POKE to force the cursor into CAPS.  Slower perhaps, but more pleasing.

12. GROWTH/LOOP TRAPPING.  The strings growing exponentially, or getting into a loop were very annoying to try to spot, hence some horrible BASIC fudging to do this.  Only simple alternating looping calculations are spotted.



It took me blooming' ages to make the .tap file of this - as I had the various bits (m/code, BASIC, LOADER, .scr, font data) all on different tap files and it was a case of loading them in, and carefully trying to save them in order, remembering how long each data block was, as where it was located etc.  Utterly tedious, and took me many many tries to get right.  There MUST be a better way of doing it than I'm doing it.

Thanks to Jim Waterman for correcting my spelling of Rihanna's name.



Anyway, I hope you enjoy 'Cliff Richard Loves Rihanna... FACT!'.  I've found it rather amusing to just repeatedly pressing enter and seeing what comes up.

Andy, June 2021.