( //make a new file: f = File("matrix", "w"); ) //fill it with a 100x100 matrix whose chances of being connected are //logarithmically decreasing as we proceed down by row. ( 100.do{|x| 100.do{ var num; num = x**4 < (100**2).rand; if(num, {f.putChar($1)}, {f.putChar($0)}); }; f.putChar($\n); } ) //close the file. ( f.close )