Skip to content

Commit 40cf050

Browse files
dovisutuleios
authored andcommitted
Bubble Sort Scratch Implementation (#610)
* added scratch to bubble sort. * reverse the comparer * fixing .md and using generated png image * Add text form scratchblock; use scratch 3 * changing to svg * Fix the svg image * Indentate text code - Indent - add Scratch textCode into .editorconfig * changes as told by @c252
1 parent 0c969cb commit 40cf050

File tree

4 files changed

+142
-0
lines changed

4 files changed

+142
-0
lines changed

.editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ indent_size = 2
145145
indent_style = space
146146
indent_size = 4
147147

148+
# Scratch (text code)
149+
[contents/*/code/scratch/*.txt]
150+
indent_style = space
151+
indent_size = 4
152+
148153
# Whitespace
149154
[*.ws]
150155
indent_style = space

contents/bubble_sort/bubble_sort.md

+6
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ This means that we need to go through the vector $$\mathcal{O}(n^2)$$ times with
6868
[import:2-14, lang:"emojicode"](code/emojicode/bubble_sort.emojic)
6969
{% sample lang="bash" %}
7070
[import:2-21, lang:"bash"](code/bash/bubble_sort.bash)
71+
{% sample lang="scratch" %}
72+
<p>
73+
<img class="center" src="code/scratch/bubble_sort.svg" width="400" />
74+
</p>
7175
{% endmethod %}
7276

7377
... And that's it for the simplest bubble sort method.
@@ -141,6 +145,8 @@ Trust me, there are plenty of more complicated algorithms that do precisely the
141145
[import, lang:"emojicode"](code/emojicode/bubble_sort.emojic)
142146
{% sample lang="bash" %}
143147
[import, lang:"bash"](code/bash/bubble_sort.bash)
148+
{% sample lang="scratch" %}
149+
The code snippet was taken from this [Scratch project](https://scratch.mit.edu/projects/316483792)
144150
{% endmethod %}
145151

146152
<script>

0 commit comments

Comments
 (0)