1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2005-2008 Jean Privat <jean@pryen.org>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Return a random generated number between 0 and self
23 var val
= (last_number
.value
* 3877 + 29573) % 139968
24 last_number
.value
= val
28 fun last_number
: Integer
30 return once
new Integer
35 readable writable var _value
: Int
44 if not args
.is_empty
then
50 var array
= new Array[Int].with_capacity
(n
)
56 var array2
= new Array[Int].with_capacity
(n
)
64 printn
(array
[n
*i
/10], " ")
71 printn
(array
[n
*i
/10], " ")
77 printn
(array2
[n
*i
/10], " ")
84 printn
(array2
[n
*i
/10], " ")