We have a great development chat happening on the Rosetta Examples release announcement thread – so I’m moving all that discussion here so that it can continue.
The idea is to make the other thread announcements-only so that it only updates periodically.
I think that the Contributions Manager doesn’t re-load its sources immediately – and for that reason it can take a while for it to pick up a change, even if you restart PDE. I’m not sure, though. But yes, forcing a manual install will always work.
I have added the Bitmap/Bézier curves/Cubic task here.
I followed your suggestion and along the strict task I also posted a visualizer code and a link to OpenProcessing to run it on line.
When posting a task code on the Rosetta page, one could get lost, because you really have to edit someone else page right on the top. Somewhat strange but that"s how to do it. Also the help/start page is not immediately visible. Unfortunately Rosetta"s home page is not editable, so I edited some other pages adding the link.
Actually, I would like to keep rosetta’s habit of using no signing at all, to maintain the possibility of changing/improving by others. Afterall it is just basic code.
I have a solution for the dragon fractal, based on contextfreeart, that you might find interesting? Jeremy Ashkenas created context free art DSL for ruby-processing that I have taken forward for JRubyArt:-
require 'cf3'
INV_SQRT = 1 / Math.sqrt(2)
def setup_the_dragon
@dragon = ContextFree.define do
shape :start do
dragon alpha: 1
end
shape :dragon do
square hue: 0, brightness: 0, saturation: 1, alpha: 0.02
split do
dragon size: INV_SQRT, rotation: -45, x: 0.25, y: 0.25
rewind
dragon size: INV_SQRT, rotation: 135, x: 0.25, y: 0.25
rewind
end
end
end
end
def settings
size 800, 500
end
def setup
sketch_title 'Heighway Dragon'
setup_the_dragon
draw_it
end
def draw_it
background 255
@dragon.render :start, size: width * 0.8, stop_size: 2,
start_x: width / 3, start_y: height / 3.5
end
JRubyArt is probably best for people familiar with ruby, who want to explore generative art. However there must be people like myself who had learned java, tried processing and then discovered ruby-processing (precursor to JRubyArt) that choose to learn ruby as an interesting alternative to java (it got me hooked). Ruby is a language that from the outset has been designed to make programmers happy. Ruby is also good for creating DSL.
Ruby is much better represented on the Rosetta site than as P5
There is another curve not present in both languages. Here is a p5 “Koch Curve” (rotate/translate) sketch.
What would be a Ruby (not rotate/translate) version.
I already have an animated example which uses this library which is stored locally. The library should be stored in a folder library/library_name and with filename library_name.rb (only recently fixed).
@jeremydouglass you are a true wizard aren’t you! You have fixed all my messed up edits and categories and sub-categories and all things at https://rosettacode.org thank you so much!
@jeremydouglass Yeah thanks for fixing mediawiki with JRubyArt at https://rosettacode.org. I’ve just posted my Color Wheel submission, somewhat based on Processing version, however I’m very proud of JRubyArt grid functionality:-
def settings
size(300, 300)
end
def setup
sketch_title 'Color Wheel'
background(0)
radius = width / 2.0
center = width / 2
grid(width, height) do |x, y|
rx = x - center
ry = y - center
sat = Math.hypot(rx, ry) / radius
if sat <= 1.0
hue = ((Math.atan2(ry, rx) / PI) + 1) / 2.0
color_mode(HSB)
col = color((hue * 255).to_i, (sat * 255).to_i, 255)
set(x, y, col)
end
end
end