Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- │ const suffixStrings = buildSuffixStringTable(query, suffixOrder)
- │ const suffixStringTable = world.table(160, 180, size, size, suffixStrings)
- │+
- │+ let color = 0
- │ for (var i = 0 ; i < nl ; i++) {
- │+
- │+ if (i >= 1) {
- │+ const sub1 = query.substr(suffixOrder[i])
- │+ const sub2 = query.substr(suffixOrder[i-1])
- │+ if (sub1.substr(0, k / 2) != sub2.substr(0, k / 2)) {
- │+ color = 1 - color
- │+ }
- │+ }
- │+
- │ for (var j = 0 ; j < k ; j++) {
- │ if (j < suffixStrings[i].length) {
- │ if (j < k / 2) {
- │- suffixStringTable.setStyle(i, j, 'fill', '#ccf')
- │+ suffixStringTable.setStyle(i, j, 'fill', color === 0 ? '#ccf' : '#cfc')
- │ } else {
- │ suffixStringTable.setStyle(i, j, 'fill', '#fcc')
- │ }
- │@@ -129,10 +140,6 @@
- │ world.remove(suffixStringTable)
- │ }
- │
- │- if (k > nl) {
- │- break;
- │- }
- │-
- │ const subStringWithIndex = []
- │ for (var i = 0 ; i < nl ; i++) {
- │ const suffix = query.substr(i)
- │@@ -163,6 +170,10 @@
- │
- │ yield("p")
- │
- │+ if (k > nl) {
- │+ break;
- │+ }
- │+
- │ world.remove(suffixStringTable)
- │ }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement