random numbers placed in data file
Author |
Message |
Houdini
|
Posted: Sun May 03, 2009 11:04 am Post subject: random numbers placed in data file |
|
|
hi
I'm trying to create a program that will place 15 random integers between the numbers 1 and 40 in a data file using the randint command but im having problems. i get this error " get atempted on incompatible stream number 1.
Turing: |
var n : int := 15
var a : array 1 .. n of int
var z : int
var v: int
randomize
for x : 1 .. n
randint (v, 1, 40)
a (x ) := v
end for
for x : 1 .. n
open : z, "integer.t", put
assert z > 0
get : z, skip
put : z, a (x )
end for
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Houdini
|
Posted: Sun May 03, 2009 11:26 am Post subject: RE:random numbers placed in data file |
|
|
problem solved.
Turing: |
var n : int := 15
var a : array 1 .. n of int
var z : int
var v : int
open : z, "integer.t", put
assert z > 0
for x : 1 .. n
randint (v, 1, 40)
a (x ) := v
put : z, skip
put : z, a (x )
end for
|
|
|
|
|
|
|
|
|