Skip to content

Instantly share code, notes, and snippets.

@martoo6
martoo6 / DanCodeChallenge.pde
Last active March 20, 2019 20:23
Dan Code Challenge
void setup(){
long code1 = 100100441;
long code2 = 100100444;
long x1l1 = code1/1000000;
long y1l1 = (code1 - (code1/1000000)*1000000 )/1000;
long x1l2 = (code1 - (code1/1000)*1000) /100;
long y1l2 = (code1 - (code1/100)*100) /10;
//The square is like this:
// _ _
final int frames = 60;
void setup(){
size(500,500,P3D);
background(0);
noFill();
stroke(255);
strokeWeight(2);
}
final int frames = 30;
void setup(){
size(500,500,P3D);
background(0);
}
void draw(){
background(0);
final int fc = frameCount;
@martoo6
martoo6 / scala
Created October 28, 2016 21:28
Markov Chain N-gram
val file = scala.io.Source.fromFile("quijote.txt")
val txt = file.mkString
val splited = txt.replace("\n", " ").replace("[ *]", " ").split(" ")
val wgram = scala.collection.mutable.HashMap[String, List[String]]()
(0 until splited.size-1).foreach{ i =>
val word = splited(i)
wgram(word) = splited(i + 1) :: wgram.getOrElse(word, Nil)
}
@martoo6
martoo6 / object_mccc_sep16.pde
Created October 6, 2016 20:39 — forked from tsulej/object_mccc_sep16.pde
The Object MCCC Sep 16
// The Object
//
// GenerateMe submission to MCCC Sep 2016
// generateme.blog@gmail.com
// http://generateme.tumblr.com/
// http://folds2d.tumblr.com/
void setup() {
size(540, 540);
@martoo6
martoo6 / 3DJoyDivision.pde
Created July 8, 2016 21:40
3D Joy Division processing sketch code
import peasy.*;
PeasyCam cam;
ArrayList<Float> arr = new ArrayList<Float>(20);
void setup(){
size(600,600, P3D);
smooth(8);
@martoo6
martoo6 / Automatic L System Iterator.pde
Created May 27, 2016 21:48
Processing Fooling Around
float seed = second();
Integer figures = 60;
void setup(){
size(1280,720, P3D);
stroke(255, 20);
blendMode(ADD);
noFill();
smooth(4);
/*for(Integer r:rules){
@martoo6
martoo6 / Grow01.scala
Created May 10, 2016 17:38
MCCC Colaboration
import main.lib._
import main.recorder.{GifRecorder, RecorderConfig}
import scala.scalajs.js.annotation.JSExport
import scala.util.Try
@JSExport
class ThreeJSApp21 extends BasicCanvas with SimplexNoise with DrawingUtils with StatsDisplay with GifRecorder with CameraControls with AutoClear{
Setup._2D.asScene
@martoo6
martoo6 / commit
Created December 14, 2015 18:53
Jira Commiter
#!/bin/bash
BRNCH=$(git rev-parse --abbrev-ref HEAD)
MSG=$1
RE='^[A-Z]+-[0-9]+$'
EXTRACT=$(echo $BRNCH | cut -d'-' -f 1-2 | awk '{print toupper($0)}')
if [[ $EXTRACT =~ $RE ]]; then
CMTMSG="$EXTRACT - $MSG"
echo "Commit message: $CMTMSG"
git commit -m "$CMTMSG"
else
package main
import processing.core._
/**
* Created by fake.vyral on 13/06/2014.
*/
class Sketch extends PApplet{
val CANTSPHERES= 20
val gridSize = 200