yojimbos_law

all palindrome item names

May 9th, 2019
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. > ash string[int] boo; string oob; foreach i in $items[]{clear(boo); oob = ""; boo = i.name.to_lower_case().split_string(""); foreach j in boo{ oob = boo[j]+oob;} if(i.name.to_lower_case() == oob) print(i);}
  2.  
  3. PB&BP
  4. repaid diaper
  5. X
  6. O
  7. G
  8. Returned: void
  9.  
  10. ==========================================================
  11. //cheatyface palindromes:
  12.  
  13. > ash string[int] boo; string oob; foreach i in $items[]{clear(boo); oob = ""; boo = i.name.to_lower_case().split_string(""); foreach j in boo{ oob = boo[j]+oob;} if(i.name.to_lower_case().replace_string(" ","") == oob.replace_string(" ","")) print(i);}
  14.  
  15. bird rib
  16. lion oil
  17. stunt nuts
  18. wet stew
  19. wet stunt nut stew
  20. Mega Gem
  21. [2268]Staff of Fats
  22. Drowsy Sword
  23. a butt tuba
  24. PB&BP
  25. accordionoid rocca
  26. dumb mud
  27. [7964]Staff of Fats
  28. repaid diaper
  29. X
  30. O
  31. G
  32. Returned: void
  33.  
  34.  
  35. =========================================
  36. \\even more cheatyface palindromes:
  37.  
  38. > ash string[int] boo; string oob; foreach i in $items[]{clear(boo); oob = ""; boo = i.name.to_lower_case().split_string(""); foreach j in boo{ oob = boo[j]+oob;} if(replace_all(create_matcher( "[^\\w]",i.name.to_lower_case() ),"") == replace_all( create_matcher( "[^\\w]",oob ),"" ) ) print(i);}
  39.  
  40. Talisman o' Namsilat
  41. bird rib
  42. lion oil
  43. stunt nuts
  44. wet stew
  45. wet stunt nut stew
  46. Mega Gem
  47. [2268]Staff of Fats
  48. Drowsy Sword
  49. a butt tuba
  50. PB&BP
  51. accordionoid rocca
  52. dumb mud
  53. Sogg-Os
  54. [7964]Staff of Fats
  55. Liam's mail
  56. repaid diaper
  57. X
  58. O
  59. G
  60. Returned: void
Advertisement
Add Comment
Please, Sign In to add comment