Postingan

Plant Life

Gambar
The Beaver loves flowers. May be this is the reason why he has invented a simple programming language for visual design based on the idea of plant life. Each picture starts with a square called a. A visual object can perform three operations: grow(), split() and die(). The following program explains the semantics:                                                     a.grow(east);  a.grow(east) ; b,c = a.split();  c.grow(north);  b.die(); Please note, that only an  oblong  object may execute the split()-Operation producing two shorter Objects of equal size. A square cannot be split. Beaver wants to write a program that transforms the left image to the right image. Which could be the first four commands of this program? Answer: A. a.grow(east); a.grow(east); b,c = a.split(); b.die(); B. a.grow(north); a.grow(east); a.grow(east); b,c =a.split(); C. a.grow(east); a.grow(east); a.grow (north); a.die(); D. a.grow(east); b,c = a.split(); c.grow(north); c.grow(east); So

Scratch: Visualisasi Selection Sort

Selection sort adalah cara pengurutan dengan menelusuri dan mencari elemen yang terkecil/terbesar dari seluruh elemen yang ada dan menempatkannya di posisi pertama sampai semua elemen terurut dengan pengulangan. Berikut merupakan contoh visualisasi selection sort menggunakan Scratch: