Skip to content

Commit c0ed22b

Browse files
june128Ken Power
authored and
Ken Power
committed
Emojicode bubble sort implementation. (algorithm-archivists#423)
* Add emojicode to the editorconfig and "book.json". * Add Emojicode Bubble Sort. * Make use of the fact, that lists are iterable.
1 parent 12cdf1d commit c0ed22b

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,8 @@ indent_size = 2
109109
[*.rs]
110110
indent_style = space
111111
indent_size = 4
112+
113+
# Emojicode
114+
[*.emojic]
115+
indent_style = space
116+
indent_size = 2

book.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@
139139
{
140140
"lang": "f90",
141141
"name": "Fortran90"
142+
},
143+
{
144+
"lang": "emojic",
145+
"name": "Emojicode"
142146
}
143147
]
144148
}

contents/bubble_sort/bubble_sort.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ This means that we need to go through the vector $$\mathcal{O}(n^2)$$ times with
5050
[import:5-9, lang:"nim"](code/nim/bubble_sort.nim)
5151
{% sample lang="f90" %}
5252
[import:19-40, lang:"fortran"](code/fortran/bubble.f90)
53+
{% sample lang="emojic" %}
54+
[import:2-14, lang:"emojicode"](code/emojicode/bubble_sort.emojic)
5355
{% endmethod %}
5456

5557
... And that's it for the simplest bubble sort method.
@@ -105,6 +107,8 @@ Trust me, there are plenty of more complicated algorithms that do precisely the
105107
[import, lang:"nim"](code/nim/bubble_sort.nim)
106108
{% sample lang="f90" %}
107109
[import, lang:"fortran"](code/fortran/bubble.f90)
110+
{% sample lang="emojic" %}
111+
[import, lang:"emojicode"](code/emojicode/bubble_sort.emojic)
108112
{% endmethod %}
109113

110114
<script>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
🐇 🥇 🍇
2+
🐇 ❗️ 🛁 numbers 🍨🐚💯🍆 🍇
3+
🐔 numbers❗️ ➡️ count
4+
5+
🔂 i 🆕⏩⏩ 0 count❗️ 🍇
6+
🔂 j 🆕⏩⏩ 1 count❗️ 🍇
7+
↪️ 🐽 numbers j ➖ 1❗️ ▶️ 🐽 numbers j❗️ 🍇
8+
🐽 numbers j ➖ 1❗️ ➡️ temp
9+
🐷 numbers j ➖ 1 🐽 numbers j❗️❗️
10+
🐷 numbers j temp❗️
11+
🍉
12+
🍉
13+
🍉
14+
🍉
15+
🍉
16+
17+
🏁 🍇
18+
🍨 1.7 -3.0 2.5 2.0 -6.0 4.4 50.0 7.0 1.5 -4.3 0.3 🍆 ➡️ numbers
19+
20+
😀 🔤unordered:🔤❗️
21+
🔂 number numbers 🍇
22+
😀 🔡 number 10❗️❗️
23+
🍉
24+
25+
🛁🐇🥇 numbers❗️
26+
27+
😀 🔤ordered:🔤❗️
28+
🔂 number numbers 🍇
29+
😀 🔡 number 10❗️❗️
30+
🍉
31+
🍉

0 commit comments

Comments
 (0)