﻿#----------------------------------------------------------------------------
# Purpose: To demonstrate programming in natural language.
# Version: Thinknowlogy 2018r4 (New Science)
#----------------------------------------------------------------------------
# Copyright (C) 2009-2018, Menno Mafait. Your suggestions, modifications,
# corrections and bug reports are welcome at http://mafait.org/contact/
#----------------------------------------------------------------------------

# Display the greeting and cleanup to avoid interference with the next greeting
If the greeting is started then display "\n~+'timestamp'<a>\"~ ~+'salutation'<a>\"~ ~+'name'<a>`~.\n\n", the age is empty, the gender is empty, the time is empty, the greeting is empty, the marital status is empty, the timestamp is empty, the salutation is empty and the name is empty.

# Determine the salutation for a male.
If the greeting is started and the gender is male then if the age is assigned and the age is less than 13 then the salutation is "Master" else the salutation is "Mr.".

# Determine the salutation for a female.
If the greeting is started and the gender is female then if the marital status is married then the salutation is "Mrs." else if the age is assigned and the age is less than 13 then the salutation is "Little Miss" else the salutation is "Miss".

# Determine the greeting according the time of the day.
If the greeting is started and the time is assigned then if the time is earlier than "06:00" then the timestamp is "Good night" else if the time is earlier than "12:00" then the timestamp is "Good morning" else if the time is earlier than "18:00" then the timestamp is "Good afternoon" else the timestamp is "Good evening".


# Now do your trick.

#---------------------
# Little Miss Robinson
#---------------------
The name is Robinson.
The gender is female.
The age is 6.
# The marital status is single.	# Obvious for a child and not relevant
The time is "07:30".
The greeting is started.
#-------------
# Master Adams
#-------------
The name is Adams.
The gender is male.
The age is 8.
# The marital status is single.	# Obvious for a child and not relevant
The time is "10:00".
The greeting is started.
#----------------
# Miss Piggy
#----------------
The name is Piggy.
The gender is female.
The age is 25.
The marital status is single.
The time is "17:00".
The greeting is started.
#----------------
# Mrs. Jones
#----------------
The name is Jones.
The gender is female.
The age is 29.
The marital status is married.
The time is "18:30".
The greeting is started.
#----------------
# Mr. Smith
#----------------
The name is Smith.
The gender is male.
The age is 32.
# The marital status is single.	# Not relevant
The time is "01:30".
The greeting is started.
# To continue, click button «Clear your mind.» or «Restart.».