mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Going over initial parts of the scripting overview.
I made a light pass over the text. Switched the includes over to the new btest-include and adapted the other TEXT-EXECs a bit. Also includes more tweaking all over the Sphinx setup.
This commit is contained in:
parent
f8c9d5e3d3
commit
b74bf10565
169 changed files with 2421 additions and 804 deletions
19
doc/scripting/framework_logging_factorial_01.bro
Normal file
19
doc/scripting/framework_logging_factorial_01.bro
Normal file
|
@ -0,0 +1,19 @@
|
|||
module Factor;
|
||||
|
||||
function factorial(n: count): count
|
||||
{
|
||||
if ( n == 0 )
|
||||
return 1;
|
||||
else
|
||||
return ( n * factorial(n - 1) );
|
||||
}
|
||||
|
||||
event bro_init()
|
||||
{
|
||||
local numbers: vector of count = vector(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
|
||||
|
||||
for ( n in numbers )
|
||||
print fmt("%d", factorial(numbers[n]));
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue