goody-goody, так?
<html>
<script>
var n = 20, m = 20;
var arr = [];
for (var j = 0; j < n; j++){
for (var i = 0; i < m; i++){
if(!arr[i]) arr[i] = [];
arr[i][j] = 0;
if(j==0 && (i==10 || i==11)){
arr[i][j] = 120;
}
if(j > 0){
if(i-1 >= 0 && i+1 < m)
arr[i][j] = 0.5 * (arr[i-1][j-1] + arr[i+1][j-1])
else if(i-1 < 0)
arr[i][j] = 0.5 * (0 + arr[i+1][j-1])
else
arr[i][j] = 0.5 * (arr[i-1][j-1] + 0)
}
}
}
for(var i=0;i<m;i++){
for(var j=0;j<n;j++){
arr[i][j] = arr[i][j].toFixed(2);
document.write(arr[i][j]+' ');
}
document.write('<br/>');
}
</script>
</html>