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

     
(_Version_Info_)
     GAME_NAME$ = "Dementia Clock"
     VERSION$ = "1.01"

     (_Initialising_)
     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
     
ON CLOSE PROC_quit : RETURN
     
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$+" tinyurl.com/superdecade"
     PROC_preventResize
     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 =============
     
REPEAT
       PROC
_display(" It is "+FN_getDay( TIME$ )+" "+FN_getTimeFrame( FN_getHours( TIME$ ) )+".")
       SYS "Sleep", 1000 : REM sleep for 1 second
     
UNTIL FALSE
     
REM ===================================


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


     
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$
     ENDPROC


     
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
     
LOCAL a$
     CASE TRUE OF
       WHEN
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"
     ENDCASE
     
= 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
       WHEN
"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"
     ENDCASE
     
= a$


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


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 )

     END


     
DEF PROC_3dname(name$, col%, bcol%)
     REM produces 3d text in ascii graphics
     REM NOTE: uses ASCII characters 255, 254
     REM
     REM modified from:
     REM http://rosettacode.org/wiki/Write_language_name_in_3D_ASCII#BBC_BASIC
     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
           VDU23,254,RND(128),RND(128),RND(128),RND(128),RND(128),RND(128),RND(128),RND(128)
           CASE TRUE OF
             WHEN
(patt% AND 2^bit%) <> 0 :COLOUR col%: PRINTCHR$(255);
             WHEN GET$(POS-1,VPOS-1) = CHR$(255): COLOUR bcol%: PRINTCHR$(254);
             OTHERWISE: PRINT " ";
           ENDCASE
         NEXT
       NEXT
char%
       PRINT
     NEXT
row%
     *refresh on
     ENDPROC


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 textfiles.com
 

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)

Introducing....GOLIATH

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)

Label