Skip to main content
added 79 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101

Python 3, 90 80 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

ThisThe function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)
s = [1,3] 
F(s,8)

Try on repl.it!

-6 bytes thanks to Copper

Python 3, 90 80 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-6 bytes thanks to Copper

Python 3, 90 80 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

The function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

Try on repl.it!

-6 bytes thanks to Copper

added 10 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101

Python 3, 90 80 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-6 bytes thanks to Copper

Python 3, 90 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-6 bytes thanks to Copper

Python 3, 90 80 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-6 bytes thanks to Copper

edited body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101

Python 3, 90 7574 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=[evals+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1]))];i+=1,;i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-56 bytes thanks to Copper

Python 3, 90 75 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=[eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1]))];i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-5 bytes thanks to Copper

Python 3, 90 74 bytes

xnor's probably going to come and destroy this solution...

def F(s,n,i=2):
 while i<n:s+=eval('%s'*3%(s[-2],'-/+*'[i%4],s[-1])),;i+=1

This function modifies the list passed to it. Use like this:

s = [1,3] 
F(s,8)

-6 bytes thanks to Copper

deleted 4 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading
added 3 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading
added 3 characters in body
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading
Source Link
FlipTack
  • 14.7k
  • 3
  • 54
  • 101
Loading