Skip to main content
added 44 characters in body
Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 35 bytes

Thanks to ErikF for correcting a bug.

x= 1x=0	:{ 98+2} ;x[ c(!T		T	,	T!T) ] ="E";x 

Try it online!Try it online!

Defines x as the vector of integers from 10 to 100, then replaces all the even values with "E" and outputs x.

Previous, quite different version:

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.

R, 35 bytes

x= 1:{ 98+2} ;x[ c(!T	,	T) ] ="E";x 

Try it online!

Defines x as the vector of integers from 1 to 100, then replaces all the even values with "E" and outputs x.

Previous, quite different version:

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.

R, 35 bytes

Thanks to ErikF for correcting a bug.

x=0	:{ 98+2} ;x[ c(	T	,!T) ] ="E";x 

Try it online!

Defines x as the vector of integers from 0 to 100, then replaces all the even values with "E" and outputs x.

Previous, quite different version:

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.

added 422 characters in body
Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 35 bytes

x= 1:{ 98+2} ;x[ c(!T	,	T) ] ="E";x 

Try it online!

Defines x as the vector of integers from 1 to 100, then replaces all the even values with "E" and outputs x.

Previous, quite different version:

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.

R, 35 bytes

x= 1:{ 98+2} ;x[ c(!T	,	T) ] ="E";x 

Try it online!

Defines x as the vector of integers from 1 to 100, then replaces all the even values with "E" and outputs x.

Previous, quite different version:

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.

Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 42 bytes

for	(i in	 1:50) write(c(i*+2- 1,	"E"),1 ) 

Try it online!

Includes a few tabs instead of spaces. Uses newlines as separators.

cat and print are unusable, but luckily write is OK. I had to resort to i*+2 -1 instead of i*2-1 to keep the alternation.