LOGO -- PREWRITTEN.LGO

The following are standard procedures that you can bring into the competition and use .
Designed by Mike Smith and tested by Lizie Dunling-Smith
-- January 1996

; Example use:-      TITLE [PROG 1]
TO TITLE :WHICHPROGRAM
	MAKE "PROMPT "?
	DRAW                          ; Clear the screen
	PRINT []
	PRINT [15TH CALGARY PROGRAMMING SOCIETY COMPETITION]
	PRINT []
	PRINT :WHICHPROGRAM
	PRINT []
	PRINT [TEAM LIZIE DUNLING - SMITH AND MIKE SMITH]
	PRINT []
	PRINT []
END

; Example Use:-      GOODBYE [THANK YOU]
TO GOODBYE :MESSAGE
	PRINT []
	PRINT []
	TYPE [DO IT AGAIN? (Y/N) ]
	MAKE "DOAGAIN RC		; Read the answer

; New suggestion -- not tested yet for syntax

; The next line you will have to change during the competition
	IF "DOAGAIN = 'Y THEN NUT	; Do NUT again
		or
	IF "DOAGAIN = 'Y THEN GOAWAY	; Do DOAWAY again

; Say GOODBYE
	PRINT :MESSAGE
	PRINT []
END

; This asks for an input and checks that it is not too high
;    and not too low

; Example use:-      INPUT 6, 20  -- Value comes back in :ANSWER
;    Must be between 6 and 20
TO INPUT.NUM :LOW :HIGH
  LABEL "INPUTNUM.START
	(TYPE [ENTER A NUMBER BETWEEN] :LOW "AND :HIGH)
	MAKE "ANSWER READ

	IF :ANSWER < :LOW (PRINT [TOO COLD TRY AGAIN] []) 
	IF :ANSWER < LOW GO "INPUTNUM.START 
	IF :ANSWER > :HIGH (PRINT [TOO HOT -- TRY AGAIN] [])
	IF :ANSWER > :HIGH GO "INPUTNUM.START

	PRINT [JUST RIGHT -- AND GODILOCKS ATE UP THE NUMBER]
	PRINT []
END

; ***************************************************************
; That's the end of the prebuilt inputs
; More may be added later
; ***************************************************************

This document last updated February 11, 1999 03:36 PM by M. Smith (smith@enel.ucalgary.ca).