Skip to main content
Commonmark migration
Source Link

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 1̶3̶3̶ 113##

Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 1̶3̶3̶ 113

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:p()
 s=s%i+e
 if s>i:s-=i;p(e-s);p();e=s
 p(e)
if s!=i:p(i-s%i)

Edit 5 Truly golfed thanks to @poke *removed line breaks etc

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 1̶3̶3̶ 113##

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:p()
 s=s%i+e
 if s>i:s-=i;p(e-s);p();e=s
 p(e)
if s!=i:p(i-s%i)

Edit 5 Truly golfed thanks to @poke *removed line breaks etc

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 1̶3̶3̶ 113

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:p()
 s=s%i+e
 if s>i:s-=i;p(e-s);p();e=s
 p(e)
if s!=i:p(i-s%i)

Edit 5 Truly golfed thanks to @poke *removed line breaks etc

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

added 227 characters in body
Source Link

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 134##1̶3̶3̶ 113##

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:
   p()
 s=s%i+e
 if s>i:
   s-=i
   p=i;p(e-s)
   p;p()
   e=s;e=s
 p(e)
if s!=i:
 p(i-s%i)

Edit 5 Truly golfed thanks to @poke *removed line breaks etc

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 134##

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:
   p()
 s=s%i+e
 if s>i:
   s-=i
   p(e-s)
   p()
   e=s
 p(e)
if s!=i:
 p(i-s%i)

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 1̶3̶3̶ 113##

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:p()
 s=s%i+e
 if s>i:s-=i;p(e-s);p();e=s
 p(e)
if s!=i:p(i-s%i)

Edit 5 Truly golfed thanks to @poke *removed line breaks etc

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

added 91 characters in body
Source Link

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 162##134##

x=eval(input())
s=0
i=15
p=print
for e in xeval(input()):
 if s>=i:
   printp()
 s=s%i+e
 if s>i:
   s=ss-i=i
   printp(e-s)
   printp()
   e=s
 printp(e)
if s!=i:
 printp(i-s%i)

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 162##

x=eval(input())
s=0
i=15
for e in x:
 if s>=i:
   print()
 s=s%i+e
 if s>i:
   s=s-i
   print(e-s)
   print()
   e=s
 print(e)
if s!=i:
 print(i-s%i)

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

##Python 3 - 1̶7̶7̶ 1̶3̶8̶ 1̶6̶6̶ 134##

s=0
i=15
p=print
for e in eval(input()):
 if s>=i:
   p()
 s=s%i+e
 if s>i:
   s-=i
   p(e-s)
   p()
   e=s
 p(e)
if s!=i:
 p(i-s%i)

Edit 4 Aliased print, and replaced a = with a -= to save a byte. Thanks to @poke and @elzell. Also moved input eval into for loop to save 2 bytes from assignment

Edit 3 Found savings in different OO inside second if

Edit 2 Fixed bug

Edit 1 Changed the input to be in the form '[1,2,3,4,5...]', and implemented first two comments, big thanks to @Morgan Thrapp

First time poster here. Input is command line with entries separated by spaces, output is entry per line, with a newline between groupings.

deleted 9 characters in body
Source Link
Loading
added 334 characters in body
Source Link
Loading
added 334 characters in body
Source Link
Loading
added 334 characters in body
Source Link
Loading
added 334 characters in body
Source Link
Loading
Source Link
Loading