[chuck-users] sleep sort port

Stefan Blixt stefan.blixt at gmail.com
Thu Jun 16 04:31:19 EDT 2011


*chuckles*

On Thu, Jun 16, 2011 at 1:44 AM, Lucas Zawacki <lfzawacki at gmail.com> wrote:

> 2011/6/15 Kassen <signal.automatique at gmail.com>:
> > Fellow ChucKists,
> > I just noticed this sorting
> > algorithm; http://dis.4chan.org/read/prog/1295544154 (should be
> work-safe,
> > despite that URL)
> > for those afraid of 4chan links and for reference, here is it;
>
> That's pretty amazing!
>
> A quick hack to make it output sound ( I made it twice as fast to
> actually keep you guys entertained):
>
> SqrOsc s => ADSR a => dac;
> 0 => s.freq;
> a.set(.5,0,0,0);
>
> int input[8];
> for (int n; n< input.size(); n++) Std.rand2(0, 20) => input[n];
>
> int output[false];
>
> fun void arrayPrinter( int arg[] )
> {
>    for (int n; n < arg.size(); n++)
>        chout <= arg[n] <= " ";
>    chout <= IO.newline();
> }
>
> fun void waiter(int length)
> {
>     (length/2.0)::second => now;
>    880 - 44*length => s.freq;
>    a.keyOn();
>    //<<<length>>>;
>     output << length;
> }
>
> arrayPrinter(input);
>
> for (int n; n< input.size(); n++) spork~waiter(input[n]);
>
> while (output.size() < input.size()) second => now;
>
> arrayPrinter(output);
>
> Cheers
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>



-- 
Release me, insect, or I will destroy the Cosmos!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20110616/5f95895d/attachment.html>


More information about the chuck-users mailing list