+
Point of view
All features
class SPREAD_ILLNESS
Summary
To compile type command : compile SPREAD_ILLNESS make
Also try Optimised version adding options "-boost -O2"
Direct parents
Insert list: ANY
Overview
Creation features
{ANY}
  • make
    Try to spreads an illness through a set of people.
Features
{}
{}
{}
world1: ARRAY2[INTEGER_8]
writable attribute
{}
world2: ARRAY2[INTEGER_8]
writable attribute
{}
empty: INTEGER_8
is 1
constant attribute
{}
healthy: INTEGER_8
is 0
constant attribute
{}
once function
{}
once function
{}
error_msg: STRING
is "Error : do it again ! "
constant attribute
{}
yes_or_no (question: STRING, default_answer: BOOLEAN): BOOLEAN
effective function
{}
make
effective procedure
{}
Try to spreads an illness through a set of people.
first_day
effective procedure
{}
Create the world in the 1st day's state.
display
effective procedure
{}
Displays current world2.
next_day
effective procedure
{}
world1 and world2 are swapped.
cure_or_die (i: INTEGER_32, j: INTEGER_32)
effective procedure
{}
When ill, inspects if must be death or more ill or cured.
die (i: INTEGER_32, j: INTEGER_32)
effective procedure
{}
When two days ill, dies or more ill ?
spread (i: INTEGER_32, j: INTEGER_32)
effective procedure
{}
spread the illness ?
effective function
{}
Is there someone is ill at i, j.
effective function
{}
Gives empty when out of range or the value in world1