Skip to main content
deleted 2 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26

Python 2.7 56 58 56 51 5048

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((1j)**1j**(ord(i)%15)for i in s))

Python 2.7 - 61 53 5250 (case insensitive)

y=lambda s:2*abs(sum((1j)**1j**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805

Python 2.7 56 58 56 51 50

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((1j)**(ord(i)%15)for i in s))

Python 2.7 - 61 53 52 (case insensitive)

y=lambda s:2*abs(sum((1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805

Python 2.7 56 58 56 51 48

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum(1j**(ord(i)%15)for i in s))

Python 2.7 - 61 53 50 (case insensitive)

y=lambda s:2*abs(sum(1j**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805
added 38 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26

Python 2.7 56 58 56 5151 50

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))

Python 2.7 - 61 53 53 52 (case insensitive)

y=lambda s:2*abs(sum((-1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805

Python 2.7 56 58 56 51

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))

Python 2.7 - 61 53 (case insensitive)

y=lambda s:2*abs(sum((-1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805

Python 2.7 56 58 56 51 50

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((1j)**(ord(i)%15)for i in s))

Python 2.7 - 61 53 52 (case insensitive)

y=lambda s:2*abs(sum((1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805
added 80 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26

Python 2.7 56 58 56 51

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))

Python 2.7 - 61 53 (case insensitive)

y=lambda s:2*abs(sum((-1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805

Python 2.7 51

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))

Python 2.7 - 53 (case insensitive)

y=lambda s:2*abs(sum((-1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805

Python 2.7 56 58 56 51

With the stolen Number One Dime from Scrooge McDuck, I made my fortune and now have more wealth than Scrooge.

y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))

Python 2.7 - 61 53 (case insensitive)

y=lambda s:2*abs(sum((-1j)**(ord(i)%16%9)for i in s))

Implementation

>>> from random import sample
>>> y=lambda s:2*abs(sum((-1j)**(ord(i)%15)for i in s))
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
20.0
>>> path=sample('RLUD'*1000, 100)
>>> y(path)
34.058772731852805
deleted 5 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
deleted 6 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
deleted 2 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
added 2 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
added 111 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
added 236 characters in body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
Rollback to Revision 1
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
edited body
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading
Source Link
Abhijit
  • 2.9k
  • 12
  • 26
Loading