From 675a3ef5198660cbde631754901691776bf29583 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Fri, 23 Apr 2021 07:58:13 +0800 Subject: [PATCH] format --- src/experimental/_impl/_tiles_wfc_impl.scad | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/experimental/_impl/_tiles_wfc_impl.scad b/src/experimental/_impl/_tiles_wfc_impl.scad index ffe9a3b7..788e3a89 100644 --- a/src/experimental/_impl/_tiles_wfc_impl.scad +++ b/src/experimental/_impl/_tiles_wfc_impl.scad @@ -113,12 +113,12 @@ function wf_entropy(wf, x, y) = ln(sumOfWeights) - (sumOfWeightLogWeights / sumOfWeights); function _wf_entropy(weights, states, state_leng, sumOfWeights, sumOfWeightLogWeights, i = 0) = -i == state_leng ? [sumOfWeights, sumOfWeightLogWeights] : -let( - opt = states[i], - weight = hashmap_get(weights, opt) -) -_wf_entropy(weights, states, state_leng, sumOfWeights + weight, sumOfWeightLogWeights + weight * ln(weight), i + 1); + i == state_leng ? [sumOfWeights, sumOfWeightLogWeights] : + let( + opt = states[i], + weight = hashmap_get(weights, opt) + ) + _wf_entropy(weights, states, state_leng, sumOfWeights + weight, sumOfWeightLogWeights + weight * ln(weight), i + 1); function _replaceStatesAt(wf, x, y, states) = let(