Just some handy examples

git-svn-id: http://picoc.googlecode.com/svn/trunk@247 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-04-15 10:46:52 +00:00
parent 48dc9c02a8
commit fdbdb116b6

View file

@ -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 }
};