Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Identity-matrix/SenseTalk/identity-matrix.sensetalk
Normal file
28
Task/Identity-matrix/SenseTalk/identity-matrix.sensetalk
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
set matrix to buildIdentityMatrix(3)
|
||||
|
||||
repeat for each item in matrix
|
||||
put it
|
||||
end repeat
|
||||
|
||||
set matrix to buildIdentityMatrix(17)
|
||||
|
||||
repeat for each item in matrix
|
||||
put it
|
||||
end repeat
|
||||
|
||||
function buildIdentityMatrix matrixSize
|
||||
set matrixList to ()
|
||||
repeat matrixSize times
|
||||
set rowMatrixIndex to the counter
|
||||
set rowMatrix to ()
|
||||
repeat matrixSize times
|
||||
if the counter equals rowMatrixIndex
|
||||
insert 1 after rowMatrix
|
||||
else
|
||||
insert 0 after rowMatrix
|
||||
end if
|
||||
end repeat
|
||||
insert rowMatrix nested after matrixList
|
||||
end repeat
|
||||
return matrixList
|
||||
end buildIdentityMatrix
|
||||
Loading…
Add table
Add a link
Reference in a new issue