TGC Codebase Backup



Random Number Example by Munchy2007

13th Jun 2013 6:03
Summary

Random Number Example



Description

Snippet to demonstrate generating a random number sequence that includes negative values.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    do
    r=Random(0,100)-50
    while GetRawKeyPressed(32)=0
        Print ("Random Number between -50 and 50: " +str(r))
        print("")
        print("Press SPACE for next random number in sequence...")
        sync()
    EndWhile
    sync()
loop