Dementia Clock

The Dementia Clock is a Windows application designed to help people living with dementia by simply displaying the time of day as morning, afternoon, evening or night.

Follow this link to DOWNLOAD the Dementia Clock (including source code).

BBC BASIC for Windows source code follows.  Please modify and share freely.

     REM A clock for dementia sufferers
     REM T Street
     REM 2013-11-21
     REM this is a very simple program for displaying a simple clock
     REM the functionality is limited to only displaying the current
     REM day of the week
     REM and whether it is morning, afternoon, evening, or night
     REM with the intention of being an aid for people with memory problems

     REM requires BBC BASIC for Windows
     REM select Options -> lowercase keywords

     GAME_NAME$ = "Dementia Clock"
     VERSION$ = "1.01"

     REM error handling (displays message and quits)
ON ERROR SYS "MessageBox", @hwnd%, REPORT$ + " at line " + STR$ERL, "Error", 48:QUIT
REM event handler for quit button
REM set size of window
VDU 23,22,880;186;32,32,2,0
     REM set window text
SYS "SetWindowText", @hwnd%, GAME_NAME$+" version "+VERSION$+""
     OFF  : REM turn text cursor
*esc off
     COLOUR 1, 255, 255, 0   : REM yellow
COLOUR 2, 0, 0, 0       : REM black
*font Times New Roman, 48b
     VDU 5 :REM allow text to be printed at graphics cursor

     REM =========== MAIN LOOP =============
_display(" It is "+FN_getDay( TIME$ )+" "+FN_getTimeFrame( FN_getHours( TIME$ ) )+".")
       SYS "Sleep", 1000 : REM sleep for 1 second
REM ===================================

     REM quit handler
     REM user gets 4 seconds to press ENTER key or program continues
     PROC_display("Now press Enter to quit.")
     g% = INKEY(400)
     IF g% = 13 THEN

DEFPROC_display( t$ )
     REM displays text at approx half way along screen
     REM no time to code a proper centering routine
COLOUR 1+128 : CLS  : REM clear background to yellow
GCOL 2     : REM set graphics colour to red (text counts as graphics after vdu 5)
MOVE 190,290
     PRINT t$

DEFFN_getHours( t$ )
     REM returns the number of hours from the string passed
     REM assuming t$ is a string obtained from time$
= VAL( MID$(t$, 17, 2) )

     DEFFN_getTimeFrame( n% )
     REM returns a time such as "morning" etc depending on the string passed
     REM midnight - 6am = night
     REM 6am - noon     = morning
     REM noon - 6pm     = afternoon
     REM gpm - midnight = evening
n% >= 0 AND n% < 6 a$ = "night"
       WHEN n% >= 6 AND n% < 12 a$ = "morning"
       WHEN n% >= 12 AND n% <18 a$ = "afternoon"
       WHEN n% >= 18 AND n% <= 23 a$ = "evening"
       OTHERWISE a$ = "undefined"
= a$

     DEFFN_getDay( t$ )
     REM returns a string representing the current day
     REM assuming t$ is a string obtained from time$
LOCAL part$
     part$ = LEFT$( t$, 3)
     CASE part$ OF
"Mon" a$ = "Monday"
       WHEN "Tue" a$ = "Tuesday"
       WHEN "Wed" a$ = "Wednesday"
       WHEN "Thu" a$ = "Thursday"
       WHEN "Fri" a$ = "Friday"
       WHEN "Sat" a$ = "Saturday"
       WHEN "Sun" a$ = "Sunday"
= a$

     DEF PROC_preventResize
     REM prevent user resizing window
     SYS "GetWindowLong", @hwnd%, -16 TO ws%
     REM prevent user maximising window
SYS "SetWindowLong", @hwnd%, -16, ws% AND NOT &50000

Create your own ASCII heading

Someone has asked me for the code that produces the coloured ASCII heading in GOLIATH, like this:

Well, it is here:

     MODE 10
     *font Courier New, 14
     PROC_3dname( " HELLO", 6, 4 )

     PROC_3dname( " WORLD", 6, 4 )


DEF PROC_3dname(name$, col%, bcol%)
     REM produces 3d text in ascii graphics
     REM NOTE: uses ASCII characters 255, 254
     REM modified from:
     REM by Richard Russell
LOCAL A%, X%, Y%, char%, row%, patt%, bit%
     DIM X% 8 : A% = 10 : Y% = X% DIV 256
     VDU 23,255,255,255,255,255,255,255,255,255

     COLOUR bcol%
     *refresh off
     FOR row% = 1 TO 8
       FOR char% = 1 TO LEN(name$)
         ?X% = ASCMID$(name$,char%)
         CALL &FFF1
         patt% = X%?row%
         FOR bit% = 7 TO 0 STEP -1
           CASE TRUE OF
(patt% AND 2^bit%) <> 0 :COLOUR col%: PRINTCHR$(255);
             WHEN GET$(POS-1,VPOS-1) = CHR$(255): COLOUR bcol%: PRINTCHR$(254);
             OTHERWISE: PRINT " ";
     *refresh on

GET LAMP: The Text Adventure Documentary

A film that brought back a few memories: GET LAMP is a documentary filmed by computer historian Jason Scott of

The film explores the people behind the first IF games (Colossal Cave, and Zork); the legacy and future of the IF medium.  Scott describes this film as The first and last IF documentary.  Enjoy!

Here is a link to the Lost Pig game mentioned at the end. (screenshot is below)


This one is for anyone who remembers the COLOSSAL CAVE adventure game, or is a fan of Interactive Fictions games, or just wants to learn some BASIC programming for the fun of it.

Presented here you will find the BB4W source code and executable versions of the program - GOLIATH.  Currently there are only 11 locations and 12 objects, and various features are not yet fully implemented, which I may get round to completing one day....

It you need some help understanding the source code, then please feel free to use the "Email Me" tab above.

Happy wandering....

(Go to the main GOLIATH page for the downloads)