Note: This forum is merely an archive. It is no longer possible to register or post. - StackOverflow
New Ace of Spades Forums: http://buildandshoot.com/

R.I.P Rubberbanding

For all things AoS!

Re: R.I.P Rubberbanding

Postby GamingFTW » Thu Jul 19, 2012 11:41 pm

I seemed to come into notice this mostly on pinpoint, so this should be great. WOOT
Image
User avatar
GamingFTW
{RS} Leader
 
Posts: 209
Joined: Thu Jan 12, 2012 6:05 pm
Location: Behind you................................. Made you look! Im infront! Too late you dead!

Re: R.I.P Rubberbanding

Postby GreaseMonkey » Fri Jul 20, 2012 11:44 am

And why would I use some website to do string<->binary conversions?
Code: Select all
w[ben@roflcopter xchatlogs]$ python
s =Python 2.7.2 (default, Mar 11 2012, 15:20:40)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> s = "01000110011000010110111001110100011000010111001101110100011010010110001"
>>> s.split()
['010001100110000101101110011101000110000101110011011101000110100101100011']
>>> s.split("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: empty separator
>>> s[::8]
'000000000'
>>> v = [s[i::8] for i in xrange(8)]
>>> v
['000000000', '111111111', '011111111', '000101100', '001000010', '101100100', '101001001', '010011011']
>>> v = [[z for z in s[i::8]] for i in xrange(8)]
>>> v
[['0', '0', '0', '0', '0', '0', '0', '0', '0'], ['1', '1', '1', '1', '1', '1', '1', '1', '1'], ['0', '1', '1', '1', '1', '1', '1', '1', '1'], ['0', '0', '0', '1', '0', '1', '1', '0', '0'], ['0', '0', '1', '0', '0', '0', '0', '1', '0'], ['1', '0', '1', '1', '0', '0', '1', '0', '0'], ['1', '0', '1', '0', '0', '1', '0', '0', '1'], ['0', '1', '0', '0', '1', '1', '0', '1', '1']]
>>> zip(v)
[(['0', '0', '0', '0', '0', '0', '0', '0', '0'],), (['1', '1', '1', '1', '1', '1', '1', '1', '1'],), (['0', '1', '1', '1', '1', '1', '1', '1', '1'],), (['0', '0', '0', '1', '0', '1', '1', '0', '0'],), (['0', '0', '1', '0', '0', '0', '0', '1', '0'],), (['1', '0', '1', '1', '0', '0', '1', '0', '0'],), (['1', '0', '1', '0', '0', '1', '0', '0', '1'],), (['0', '1', '0', '0', '1', '1', '0', '1', '1'],)]
>>> zip(*v)
[('0', '1', '0', '0', '0', '1', '1', '0'), ('0', '1', '1', '0', '0', '0', '0', '1'), ('0', '1', '1', '0', '1', '1', '1', '0'), ('0', '1', '1', '1', '0', '1', '0', '0'), ('0', '1', '1', '0', '0', '0', '0', '1'), ('0', '1', '1', '1', '0', '0', '1', '1'), ('0', '1', '1', '1', '0', '1', '0', '0'), ('0', '1', '1', '0', '1', '0', '0', '1'), ('0', '1', '1', '0', '0', '0', '1', '1')]
>>> x = [l.join for l in zip(*v)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'join'
>>> x = [''.join(l) for l in zip(*v)]
>>> x
['01000110', '01100001', '01101110', '01110100', '01100001', '01110011', '01110100', '01101001', '01100011']
>>> [str("0b"+r) for r in x]
['0b01000110', '0b01100001', '0b01101110', '0b01110100', '0b01100001', '0b01110011', '0b01110100', '0b01101001', '0b01100011']
>>> [eval("0b"+r) for r in x]
[70, 97, 110, 116, 97, 115, 116, 105, 99]
>>> [chr(eval("0b"+r)) for r in x]
['F', 'a', 'n', 't', 'a', 's', 't', 'i', 'c']
>>>


Or, as a one-liner function:
Code: Select all
f = lambda s : ''.join([chr(eval("0b"+r)) for r in [''.join(l) for l in zip(*[s[i::8] for i in xrange(8)])]])


So in other words, it'll be proper rubberbanding, rather than teleporting D:
GreaseMonkey
Bastion Member
 
Posts: 84
Joined: Tue Dec 13, 2011 10:14 pm
Location: ←        

Re: R.I.P Rubberbanding

Postby nalyd8991 » Fri Jul 20, 2012 5:38 pm

nimdahk wrote:
nalyd8991 wrote:Aw man, rubberbanding saves my life every time I play hallway.

By preventing you from meeting anyone?

Real funny dude.
Image
User avatar
nalyd8991
Member
 
Posts: 66
Joined: Mon Jan 16, 2012 9:47 pm

Previous

Return to Ace of Spades Discussion



Who is online

Users browsing this forum: No registered users and 2 guests

cron