Sep. 24th, 2007

tgies: (Default)
def totsusan( words = "LOOPY BROAD", guy = "凸(・`Д・´o)" )
  words.upcase!
  words = words.tr('A-Z0-9\'', 'A-Z0-9’')
  wordarray = words.split(' ')
  guy = guy.toutf8
  # chunk is some generic helper crap to split an array into n pieces with as equal a number of elements as possible
  # figure it out
  left, right = *wordarray.chunk(2)
  # note that fullwidth spaces are used here
  totsusanstring = left.join(' ') + "━━━" + guy + "━━━" + right.join(' ')
  return totsusanstring
end

I would like to take this time to point out that Ruby is kind of weird

THIS CODE IS HEREBY RELEASED UNDER THE CREATIVE COMMONS NONCOMMERCIAL SHno

Profile

tgies: (Default)
tgies

September 2016

S M T W T F S
    123
45 678910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 29th, 2026 08:22 pm
Powered by Dreamwidth Studios