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
int max_rand_step = 5; | |
int frame_num = 0; | |
int shape_opacity = 20; | |
int num_of_rects = 40; | |
void setup(){ | |
size(displayWidth, displayHeight); | |
frameRate(40); | |
} |
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
initLocalStorageArray = (name)-> | |
if (localStorage.getItem(name)==null)||(localStorage.getItem(name)[0]!='[') | |
localStorage.setItem(name,'[]') | |
offlineArrays = ['array1','array2'] | |
offlineArrays.forEach (n)->initLocalStorageArray(n) | |
clearArrays = -> | |
offlineArrays.forEach (n)->localStorage.setItem(n,'[]') |
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
var wordwrap = function(long_string, max_char){ | |
var sum_length_of_words = function(word_array){ | |
var out = 0; | |
if (word_array.length!=0){ | |
for (var i=0; i<word_array.length; i++){ | |
var word = word_array[i]; | |
out = out + word.length; | |
} | |
}; |