This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pixar.cpp | |
// Ran through clang-format, then commented | |
// Also changed text to "HIRE ME" and used fork() | |
// to have 4 child processes for easy multithreading | |
// | |
// Original by Andrew Kensler | |
// Edits by Adrian Biagioli | |
#include <stdlib.h> // card > pixar.ppm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// hid.c, edited to fix a regression in hid_write on the MS bluetooth stack | |
// For brevity irrelevant code has been omitted. | |
// Additions are marked with !!ADDED!! | |
// There are no modifications except for hid_write() | |
// ... | |
#ifndef HIDAPI_USE_DDK | |
/* Since we're not building with the DDK, and the HID header | |
files aren't part of the SDK, we have to define all this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Perlin { | |
public int repeat; | |
public Perlin(int repeat = -1) { | |
this.repeat = repeat; | |
} | |
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) { | |
double total = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Perlin { | |
public static double OctavePerlin(double x, double y, double z, int octaves, double persistence) { | |
double total = 0; | |
double frequency = 1; | |
double amplitude = 1; | |
for(int i=0;i<octaves;i++) { | |
total += perlin(x * frequency, y * frequency, z * frequency) * amplitude; | |
amplitude *= persistence; |