Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <script type="text/javascript">
- function rand(min, max)
- {
- max = max || false;
- min = min || 255;
- if (max)
- {
- return Math.floor(Math.random()*(max-min+1))+min;
- }
- else
- {
- return Math.floor(Math.random()*(min+1));
- }
- }
- function zapolnenie(){
- var matrixBig = [];
- for(y = 0; y<6; y++){
- matrixBig[y] = [];
- for( x = 0; x<6; x++)
- matrixBig[y][x] = rand(10,100);
- }
- return matrixBig;
- }
- function printMatrix(matrix){
- if (!matrix instanceof Array)
- return;
- document.write("<table border=1>");
- for(y = 0; y < matrix.length; y++){
- for(x = 0; x < matrix[y].length; x++){
- document.write('<td>',matrix[y][x],'</td>');
- }
- document.write('</tr>');
- }
- document.write('</table>');
- }
- </script>
- <body onload = printMatrix(zapolnenie())>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment