Skip to content

Commit 18e988d

Browse files
dovisutuleios
andauthored
Update images of Scratch Implemantation to Scratch3 (#618)
* Update Thomas Algorithm to Scratch3 * Update Tree Traversal to Scratch3 * Compress Thomas.svg * Add full code after text Co-authored-by: James Schloss <[email protected]>
1 parent 9d75502 commit 18e988d

File tree

13 files changed

+888
-10
lines changed

13 files changed

+888
-10
lines changed

contents/thomas_algorithm/code/scratch/thomas.svg

+112-1
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
define Solvetridiagonalsystem
2+
set [n v] to (length of [b v])
3+
if <not <(item (1 v) of [b v]) = [0]>> then
4+
replace item (1 v) of [c v] with ((item (1 v) of [c v]) / (item (1 v) of [b v]))
5+
replace item (1 v) of [d v] with ((item (1 v) of [d v]) / (item (1 v) of [b v]))
6+
end
7+
set [indx v] to (2)
8+
repeat ((n) - (1))
9+
if <not <((item (indx) of [b v]) - ((item (indx) of [a v]) * (item ((indx) - (1)) of [c v]))) = [0]>> then
10+
replace item (indx) of [c v] with ((item (indx) of [c v]) / ((item (indx) of [b v]) - ((item (indx) of [a v]) * (item((indx) - (1)) of [c v]))))
11+
replace item (indx) of [d v] with (((item (indx) of [c v]) - ((item (indx) of [a v]) * (item ((indx) - (1)) of [d v]))) / ((item (indx) of [b v]) - ((item (indx) of [a v]) * (item ((indx) - (1)) of [c v])))
12+
end
13+
change [indx v] by (1)
14+
end
15+
delete (all v) of [x v]
16+
add (item (last v) of [d v]) to [x v]
17+
set [indx v] to ((n) - (1))
18+
repeat ((n) - (1))
19+
insert ((item (indx) of [d v]) - ((item(indx) of [c v]) * (item (1 v) of [x v]))) at (1 v) of [x v]
20+
change [indx v] by (-1)
21+
end

contents/tree_traversal/code/scratch/all.svg

+1
Loading

contents/tree_traversal/code/scratch/bfs.svg

+112-1
Loading

contents/tree_traversal/code/scratch/dfs-from.svg

-1
This file was deleted.

0 commit comments

Comments
 (0)