GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
tutorial
>
PYRAMID2
+
Point of view
All features
ANY
All features
class PYRAMID2
Summary
top
Run faster than pyramid.e
Direct parents
Insert list:
ARGUMENTS
Overview
top
Creation features
{
ANY
}
make
Features
{}
pyramid
:
ARRAY2
[
INTEGER_32
]
used
:
ARRAY
[
BOOLEAN
]
Already used numbers in
pyramid
.
make
fill
(size:
INTEGER_32
)
Fill in a
pyramid
of
size
elements.
put
(value:
INTEGER_32
, line:
INTEGER_32
, column:
INTEGER_32
)
Update
pyramid
and
used
.
remove
(line:
INTEGER_32
, column:
INTEGER_32
)
Update
pyramid
and
used
.
solution
(column:
INTEGER_32
):
BOOLEAN
Search a solution using a back-tracking algorithm.
fill_column
(col:
INTEGER_32
, val:
INTEGER_32
):
BOOLEAN
{
ANY
}
print_on
(file:
OUTPUT_STREAM
)
Display the pyramid to the standard output.
{
ANY
}
argument_count
:
INTEGER_32
Number of arguments given to command that started system execution (command name does not count).
argument
(i:
INTEGER_32
):
STRING
i
th argument of command that started system execution Gives the command name if
i
is 0.
command_name
:
STRING
{}
command_arguments
:
FAST_ARRAY
[
STRING
]
Give access to arguments command line including the command name at index 0.
Implementation of
ARGUMENTS
(do not use directly):
{}
se_argc
:
INTEGER_32
To implement
command_arguments
se_argv
(i:
INTEGER_32
):
STRING
To implement
command_arguments
pyramid
:
ARRAY2
[
INTEGER_32
]
writable attribute
{}
top
used
:
ARRAY
[
BOOLEAN
]
writable attribute
{}
top
Already used numbers in
pyramid
.
make
effective procedure
{}
top
fill
(size:
INTEGER_32
)
effective procedure
{}
top
Fill in a
pyramid
of
size
elements.
require
size > 1
put
(value:
INTEGER_32
, line:
INTEGER_32
, column:
INTEGER_32
)
effective procedure
{}
top
Update
pyramid
and
used
.
remove
(line:
INTEGER_32
, column:
INTEGER_32
)
effective procedure
{}
top
Update
pyramid
and
used
.
solution
(column:
INTEGER_32
):
BOOLEAN
effective function
{}
top
Search a solution using a back-tracking algorithm.
fill_column
(col:
INTEGER_32
, val:
INTEGER_32
):
BOOLEAN
effective function
{}
top
print_on
(file:
OUTPUT_STREAM
)
effective procedure
{
ANY
}
top
Display the pyramid to the standard output.
require
file.is_connected
argument_count
:
INTEGER_32
effective function
{
ANY
}
top
Number of arguments given to command that started system execution (command name does not count).
ensure
Result >= 0
argument
(i:
INTEGER_32
):
STRING
effective function
{
ANY
}
top
i
th argument of command that started system execution Gives the command name if
i
is 0.
require
i >= 0
i <=
argument_count
ensure
Result /= Void
command_name
:
STRING
effective function
{
ANY
}
top
command_arguments
:
FAST_ARRAY
[
STRING
]
frozen
once function
{}
top
Give access to arguments command line including the command name at index 0.
This is a once function, so you can modify command-line arguments! (NOTE: just be sure not to remove the first argument, although you may change it)
ensure
not Result.is_empty
se_argc
:
INTEGER_32
{}
top
To implement
command_arguments
se_argv
(i:
INTEGER_32
):
STRING
{}
top
To implement
command_arguments