https://github.com/jrincayc/ucblogo-code
Raw File
Tip revision: 33bc65673ca25089c9acaf8a9eb44bb780686105 authored by Joshua Cogliati on 30 December 2020, 15:37:02 UTC
Merge pull request #85 from jrincayc/release_6_2_work
Tip revision: 33bc656
case
CASE value clauses					(library procedure)

	command or operation.  The second input is a list of lists (clauses);
	each clause is a list whose first element is either a list of values
	or the word ELSE and whose butfirst is a Logo expression or
	instruction.  CASE examines the clauses in order.  If a clause begins
	with the word ELSE (upper or lower case), then the butfirst of that
	clause is evaluated and CASE outputs its value, if any.  If the first
	input to CASE is a member of the first element of a clause, then the
	butfirst of that clause is evaluated and CASE outputs its value, if
	any.  If neither of these conditions is met, then CASE goes on to the
	next clause.  If no clause is satisfied, CASE does nothing.  Example:

		to vowelp :letter
		output case :letter [ [[a e i o u] "true] [else "false] ]
		end

back to top