Just some handy examples
git-svn-id: http://picoc.googlecode.com/svn/trunk@247 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
48dc9c02a8
commit
fdbdb116b6
|
@ -73,7 +73,7 @@ void Cpeek(struct ParseState *Parser, struct Value *ReturnValue, struct Value **
|
|||
|
||||
void Crandom(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||
{
|
||||
ReturnValue->Val->Integer = 1234;
|
||||
ReturnValue->Val->Integer = random() % Param[0]->Val->Integer;
|
||||
}
|
||||
|
||||
void Cpoke(struct ParseState *Parser, struct Value *ReturnValue, struct Value **Param, int NumArgs)
|
||||
|
@ -112,7 +112,7 @@ struct LibraryFunction PlatformLibrary[] =
|
|||
{ ShowComplex, "void ShowComplex(struct complex *)" },
|
||||
{ Cpeek, "int peek(int, int)" },
|
||||
{ Cpoke, "void poke(int, int, int)" },
|
||||
{ Crandom, "int random(int, int)" },
|
||||
{ Crandom, "int random(int)" },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue