Javascript port of gorillas.bas