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