From fdbdb116b6ad9c27c96e097789591c66a7fe8010 Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Wed, 15 Apr 2009 10:46:52 +0000 Subject: [PATCH] Just some handy examples git-svn-id: http://picoc.googlecode.com/svn/trunk@247 21eae674-98b7-11dd-bd71-f92a316d2d60 --- library_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library_unix.c b/library_unix.c index 678098c..4d5e97e 100644 --- a/library_unix.c +++ b/library_unix.c @@ -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 } };