Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. ```
  2. │ const suffixStrings = buildSuffixStringTable(query, suffixOrder)
  3. │ const suffixStringTable = world.table(160, 180, size, size, suffixStrings)
  4. │+
  5. │+ let color = 0
  6. │ for (var i = 0 ; i < nl ; i++) {
  7. │+
  8. │+ if (i >= 1) {
  9. │+ const sub1 = query.substr(suffixOrder[i])
  10. │+ const sub2 = query.substr(suffixOrder[i-1])
  11. │+ if (sub1.substr(0, k / 2) != sub2.substr(0, k / 2)) {
  12. │+ color = 1 - color
  13. │+ }
  14. │+ }
  15. │+
  16. │ for (var j = 0 ; j < k ; j++) {
  17. │ if (j < suffixStrings[i].length) {
  18. │ if (j < k / 2) {
  19. │- suffixStringTable.setStyle(i, j, 'fill', '#ccf')
  20. │+ suffixStringTable.setStyle(i, j, 'fill', color === 0 ? '#ccf' : '#cfc')
  21. │ } else {
  22. │ suffixStringTable.setStyle(i, j, 'fill', '#fcc')
  23. │ }
  24. │@@ -129,10 +140,6 @@
  25. │ world.remove(suffixStringTable)
  26. │ }
  27. │- if (k > nl) {
  28. │- break;
  29. │- }
  30. │-
  31. │ const subStringWithIndex = []
  32. │ for (var i = 0 ; i < nl ; i++) {
  33. │ const suffix = query.substr(i)
  34. │@@ -163,6 +170,10 @@
  35. │ yield("p")
  36. │+ if (k > nl) {
  37. │+ break;
  38. │+ }
  39. │+
  40. │ world.remove(suffixStringTable)
  41. │ }
  42. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement