(aGrid, nX1, nY1, nX2, nY2, nTL, nTR, nBL, nBR, nLim, nRecursive, nCR, nCG, nCB)
| 163 | |
| 164 | |
| 165 | def FracDown(aGrid, nX1, nY1, nX2, nY2, nTL, nTR, nBL, nBR, nLim, nRecursive, nCR, nCG, nCB): |
| 166 | |
| 167 | # fractal lanscape grenerator |
| 168 | |
| 169 | dx = nX2 - nX1 |
| 170 | |
| 171 | dy = nY2 - nY1 |
| 172 | |
| 173 | nS = aScale[nRecursive] |
| 174 | |
| 175 | nT = dist((nTL + nTR) / 2, nS * nHorizFactor) |
| 176 | |
| 177 | nL = dist((nTL + nBL) / 2, nS) |
| 178 | |
| 179 | nR = dist((nTR + nBR) / 2, nS) |
| 180 | |
| 181 | nB = dist((nBL + nBR) / 2, nS * nHorizFactor) |
| 182 | |
| 183 | nM = dist((nTL + nTR + nBL + nBR) / 4, nS * nDiagFactor) |
| 184 | |
| 185 | nSC = aColour[nRecursive] |
| 186 | |
| 187 | nCR = dist(nCR, nSC) |
| 188 | |
| 189 | nCG = dist(nCG, nSC) |
| 190 | |
| 191 | nCB = dist(nCB, nSC) |
| 192 | |
| 193 | nXm = mid(nX1, nX2) |
| 194 | |
| 195 | nYm = mid(nY1, nY2) |
| 196 | |
| 197 | |
| 198 | |
| 199 | if dx <= nLow and dy <= nLow: |
| 200 | |
| 201 | if ZeroToOne(nM, nMSpan) > nLim: |
| 202 | |
| 203 | DrawSplash(nXm, nYm, AutumnPastels(nCR, nCG, nCB)) |
| 204 | |
| 205 | return |
| 206 | |
| 207 | nTL = Load(aGrid, nX1, nY2, nTL) |
| 208 | |
| 209 | nTR = Load(aGrid, nX2, nY2, nTR) |
| 210 | |
| 211 | nBL = Load(aGrid, nX1, nY1, nBL) |
| 212 | |
| 213 | nBR = Load(aGrid, nX1, nY1, nBR) |
| 214 | |
| 215 | t1 = (aGrid, nX1, nYm, nXm, nY2, nTL, nT, nL, nM, nLim, nRecursive + 1, nCR, nCG, nCB) |
| 216 | |
| 217 | t2 = (aGrid, nXm, nYm, nX2, nY2, nT, nTR, nM, nR, nLim, nRecursive + 1, nCR, nCG, nCB) |
| 218 | |
| 219 | t3 = (aGrid, nX1, nY1, nXm, nYm, nL, nM, nBL, nB, nLim, nRecursive + 1, nCR, nCG, nCB) |
| 220 | |
| 221 | t4 = (aGrid, nXm, nY1, nX2, nYm, nM, nR, nB, nBR, nLim, nRecursive + 1, nCR, nCG, nCB) |
| 222 |
no test coverage detected