# Rosetta Examples development

**URL:** https://discourse.processing.org/t/rosetta-examples-development/18945
**Category:** Development
**Created:** [March 23, 2020, 8:04pm UTC](https://discourse.processing.org/t/rosetta-examples-development/18945 "2020-03-23T20:04:11Z")
**Posts on this page:** 1
**Showing post:** 72

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [September 5, 2020, 1:55am UTC](https://discourse.processing.org/t/rosetta-examples-development/18945/72 "2020-09-05T01:55:07Z")

</div>

> [@noel](#):
>
> @GoToLoop did you give it a try?

Well, I did. But it took me more time. 🕰

I’ve based mine on the Go version (although I barely know anything about that Google language): 🥴  
[RosettaCode.org/wiki/Sierpinski\_pentagon#Go](http://RosettaCode.org/wiki/Sierpinski_pentagon#Go)

That version uses a fixed palette of 5 primary colors. 🖌

In my sketch conversion I keep track of the current palette's index by returning it at the end of the recursive **pentagon()** function. 📐

In order to get a free color **fill()** I’m using **beginDraw()** + **vertex()** to draw each Sierpinski pentagon. 🖼

The 1st sketch below is the Java Mode version w/ no special optimization: ☕

https://www.openprocessing.org/sketch/955443/embed/

2nd sketch is the p5.js version, which caches all **cos()** & **sin()** calcs inside 2 [Float32Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) containers, similar to what I already did before to the Python Mode conversion: 💡

https://www.openprocessing.org/sketch/955445/embed/

---

_[View the full topic](https://discourse.processing.org/t/rosetta-examples-development/18945)._
