Skip to content

Instantly share code, notes, and snippets.

@mohayonao
Created May 12, 2016 11:32
Show Gist options
  • Select an option

  • Save mohayonao/c6a15285562b99ac5e91864775563027 to your computer and use it in GitHub Desktop.

Select an option

Save mohayonao/c6a15285562b99ac5e91864775563027 to your computer and use it in GitHub Desktop.
beep
"use strict";
const output = new Float32Array(8192).map((_, i) => Math.sin(i));
process.stdout.write(Buffer.from(output.buffer));
import sys, math, struct
output = [ math.sin(i) for i in range(8192) ]
sys.stdout.write(struct.pack('8192f', *output))
output = 8192.times.map {|i| Math.sin(i)}
STDOUT.write output.pack('f*')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment