Skip to main content
added 11 characters in body
Source Link

Turtlèd, 490 487 487451 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

Golfed some bytes removing useless code, and some other tricks

?#0#.:l( [*l]u>;,u,[ :ll[*,l]:' l' l{*l}rd]l]d],u{*{*r}l' d{ l}[ (*'0d*.d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l9.l( '0.))]u[ r]lu}u[#[u2[#[ dd;{ l}[ (0u'00u.)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd'#;))(1'0dd1.;)(2'1dd2'1;)(3'2dd3'2;)(4'3dd4'3;)(5'4dd5'4;)(6'5dd6'5;)(7'6dd7'6;)(8'7dd8'7;)(9'8dd9'8;)]uuu[*r]{*l}u{*r}'*{*l}rrdd:;{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[:;d[ (0'9l( '#l))(1'0d1.d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[u[ r]luur]uu)][ [ l]r[ ' r]ul],)(*'0)

Try it online!Try it online!

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program writes 0, takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, removing the zero that was written, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Turtlèd, 490 487 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

?:l( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

Try it online!

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Turtlèd, 490 487 451 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

Golfed some bytes removing useless code, and some other tricks

?#0#.:l( >;,u,[ :ll[*,l]d],u{*{*r}l' d{ l}[ (*.d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9.l( .))]u[ r]lu}u2[#[ ;{ l}[ (0u.)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#;))(1.;)(2'1;)(3'2;)(4'3;)(5'4;)(6'5;)(7'6;)(8'7;)(9'8;)]uuu[*r]{*l}u{*r}'*{*l}:;{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}:;d[ (0'9l( '#l))(1.d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( u[ r]uu)][ [ l]r[ ' r]ul],)

Try it online!

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program writes 0, takes integer input, if it is not one (if it is, it skips the rest of the code), it writes out two lines of asterisks, removing the zero that was written, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

added 721 characters in body
Source Link

Turtlèd, 490 487 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

?:l( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

Try it online!

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Turtlèd, 490 487 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

?:l( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Turtlèd, 490 487 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

?:l( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

Try it online!

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

added 58 characters in body
Source Link

Turtlèd, 490490 487 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

?:( l)( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Turtlèd, 490 bytes

Turtlèd does not support newlines in code... so oneliner fun!

?:( l)( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Turtlèd, 490 487 bytes

Turtlèd does not support newlines in code... so oneliner fun!

golfed some bytes for not needing to support 0

?:l( [*l]u,[ :ll[*,l]:' l' l{*l}rd],u{*{*r}l' d{ l}[ (*'0d)(0'1d)(1'2d)(2'3d)(3'4d)(4'5d)(5'6d)(6'7d)(7'8d)(8'9d)(9'0l( '0))]u[ r]lu}u[#[ dd{ l}[ (0u'0)(1u'1)(2u'2)(3u'3)(4u'4)(5u'5)(6u'6)(7u'7)(8u'8)(9u'9)dl]ur[ r]l[#[ r]l[ (0'9l( '#dd))(1'0dd)(2'1dd)(3'2dd)(4'3dd)(5'4dd)(6'5dd)(7'6dd)(8'7dd)(9'8dd)]uuu[*r]{*l}u{*r}'*{*l}rrdd{ l}[ l]r]' uu[*r]{*r}d]l(*,(*@1)(1@0)'*)u{*' l}rrddd[ (0'9l( '#l))(1'0d)(2'1d)(3'2d)(4'3d)(5'4d)(6'5d)(7'6d)(8'7d)(9'8d)]r( lu[ r]luu)][ [ l]r[ ' r]ul],)(*'0)

I am most certainly not going to explain this with the annotations for each part of the code, at least not right now.

General explanation:

The program takes integer input, if it is not one or zero (if it is, it skips the rest of the code and writes 0), it writes out two lines of asterisks, one to compare for the prime checking, one to turn into a decimal string. It turns the lower one into a decimal string, then moves the decimal string up one. It writes out a single asterisk into a line above the other for each decrement of the upper decimal string. when goes below zero, the program moves the decimal string back up again, and keeps going on the upper line until it either aligns with the lower line, or goes past it. If it aligns, it sets the character variable to 1, if the character variable has not already been set to one. This is because it has no method to distinguish one when testing divisibility, so this makes it so it has to have more than one factor match. If it has been set to one, it sets it to zero. After it has tested all the numbers from n-1 to 1, it cleans up all the mess that it used to test the primality, then writes the character variable, which will be one if prime, else 0

Post Undeleted by Destructible Lemon
added 91 characters in body
Source Link
Loading
Post Deleted by Destructible Lemon
Source Link
Loading