From 17ba9da2b4d98a61c6dc785b6fdbb70276b70ada Mon Sep 17 00:00:00 2001 From: Amaras Date: Wed, 15 Jul 2020 15:26:17 +0200 Subject: [PATCH 1/5] Added Bubblesort in Coconut --- contents/bubble_sort/bubble_sort.md | 4 ++++ contents/bubble_sort/code/coconut/bubblesort.coco | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 contents/bubble_sort/code/coconut/bubblesort.coco diff --git a/contents/bubble_sort/bubble_sort.md b/contents/bubble_sort/bubble_sort.md index 8b5b6b8e8..df80886f7 100644 --- a/contents/bubble_sort/bubble_sort.md +++ b/contents/bubble_sort/bubble_sort.md @@ -78,6 +78,8 @@ This means that we need to go through the vector $$\mathcal{O}(n^2)$$ times with [import:1-6, lang:"coffeescript"](code/coffeescript/bubblesort.coffee) {% sample lang="r" %} [import:1-12, lang:"r"](code/r/bubble_sort.R) +{% sample lang="coco" %} +[import:3-8, lang:"coconut"](code/coconut/bubblesort.coco) {% endmethod %} ... And that's it for the simplest bubble sort method. @@ -159,6 +161,8 @@ The code snippet was taken from this [Scratch project](https://scratch.mit.edu/p [import, lang:"coffeescript"](code/coffeescript/bubblesort.coffee) {% sample lang="r" %} [import, lang:"r"](code/r/bubble_sort.R) +{% sample lang="coco" %} +[import, long:"coconut"](code/coconut/bubblesort.coco) {% endmethod %}