Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Identity-matrix/BBC-BASIC/identity-matrix.basic
Normal file
17
Task/Identity-matrix/BBC-BASIC/identity-matrix.basic
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
INPUT "Enter size of matrix: " size%
|
||||
PROCidentitymatrix(size%, im())
|
||||
FOR r% = 0 TO size%-1
|
||||
FOR c% = 0 TO size%-1
|
||||
PRINT im(r%, c%),;
|
||||
NEXT
|
||||
PRINT
|
||||
NEXT r%
|
||||
END
|
||||
|
||||
DEF PROCidentitymatrix(s%, RETURN m())
|
||||
LOCAL i%
|
||||
DIM m(s%-1, s%-1)
|
||||
FOR i% = 0 TO s%-1
|
||||
m(i%,i%) = 1
|
||||
NEXT
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue