Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Identity-matrix/BASIC256/identity-matrix.basic
Normal file
25
Task/Identity-matrix/BASIC256/identity-matrix.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
arraybase 1
|
||||
do
|
||||
input "Enter size of matrix: ", n
|
||||
until n > 0
|
||||
|
||||
dim identity(n, n) fill 0 #we fill everything with 0
|
||||
|
||||
# enter 1s in diagonal elements
|
||||
for i = 1 to n
|
||||
identity[i, i] = 1
|
||||
next i
|
||||
|
||||
# print identity matrix if n < 40
|
||||
print
|
||||
|
||||
if n < 40 then
|
||||
for i = 1 to n
|
||||
for j = 1 to n
|
||||
print identity[i, j];
|
||||
next j
|
||||
print
|
||||
next i
|
||||
else
|
||||
print "Matrix is too big to display on 80 column console"
|
||||
end if
|
||||
Loading…
Add table
Add a link
Reference in a new issue