You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update on this issue: the problem is related to the fact that the Word array used for two subsequent WordCram is the same.
However, the class Word holds memory of some information related to the WordCram the word was involved in.
For instance, once a word is skipped for the first time, the attribute
Word.skippedBecause
is set to a value explaining why the word was skip.
Upon drawing a new WordCram, this skippedReason persists. The piece of code handling word collision will do the following:
boolean foundOverlap = false;
for (int i = 0; !foundOverlap && i < eWordIndex; i++) {
EngineWord otherWord = eWords[i];
if (otherWord.wasSkipped()) continue; //can't overlap with skipped word
if (eWord.overlaps(otherWord)) {
foundOverlap = true;
lastCollidedWith = otherWord;
}
}
if (!foundOverlap) {
eWord.finalizeLocation();
return true;
}
Here, the otherword may have been skipped in a previous wordcram: collision detection will not apply.
The proposed fix is to delegate the skipped/not skipped property to the WordCram class.
Using Processing 2 on mac os,
when clicking on the outputwindow, the wordcram is redrawn, however some names are placed on top of each other.
I assume this is related to the instanciation of WordCram:
I believe the "this" passed as argument keeps artifact values that disrupt the new wordcram.
The text was updated successfully, but these errors were encountered: