Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
25
Task/Identity-matrix/Ring/identity-matrix.ring
Normal file
25
Task/Identity-matrix/Ring/identity-matrix.ring
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
size = 5
|
||||
im = newlist(size, size)
|
||||
identityMatrix(size, im)
|
||||
for r = 1 to size
|
||||
for c = 1 to size
|
||||
see im[r][c]
|
||||
next
|
||||
see nl
|
||||
next
|
||||
|
||||
func identityMatrix s, m
|
||||
m = newlist(s, s)
|
||||
for i = 1 to s
|
||||
m[i][i] = 1
|
||||
next
|
||||
return m
|
||||
|
||||
func newlist x, y
|
||||
if isstring(x) x=0+x ok
|
||||
if isstring(y) y=0+y ok
|
||||
alist = list(x)
|
||||
for t in alist
|
||||
t = list(y)
|
||||
next
|
||||
return alist
|
||||
Loading…
Add table
Add a link
Reference in a new issue