#This file is part of pilang. # #pilang is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, either version 3 of the License, or #(at your option) any later version. # #pilang is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with pilang. If not, see . # Enable error catching catch True # Initialise stuff set wasword,was # Get input from user set errnonum,Whatever you typed in... It's definitely not a number!!! set name,$input "Name: " cmp equal,$~name,,"print What? That person has no name???",exit 1 set current year,$input "Current year: " cmp isnotnum,$~current year,0,print $~errnonum,exit 2 set birth year,$input "Year of birth: " cmp isnotnum,$~birth year,0,print $~errnonum,exit 3 # Check if birth year is before current year cmp smaller,$~current year,$~birth year,"print Will ,$~name, be born in the future?","set yesno,$input Yes/No?: ","cmp equal,$lower $~yesno,no,exit 4","cmp nonequal,$lower $~yesno,yes,print I give you up... Bye!,exit 4","set wasword,will be" # Print result print $~name, ,$~wasword, born in ,$~current year,",", so I guess he is ,$"sub asint,$~current year,$~birth year", Years old!