Print the Lost numbers
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
As a big fan of the Lost TV series, I always got intrigued by the sequence of numbers that repetitively appears on the episodes. These numbers are:
$ 4, 8, 15, 16, 23, 42$ (A104101)
Using any programming language, write a code that outputs these numbers.
Scoring:
Shortest answer wins
The output must not contain any other numbers or letters. You may use any other character as separator, or even no separator at all.
You cannot separate digits of the same number. $ 48_15162342 $ is a valid answer, but $481_5162342$ is not.
You must respect the order.
If your code does not contain any of the numbers from the sequence, reduce your score by 30%. This rule does allow you to enter the digits separately. E.g.:
abcde1fg5h
Is a valid candidate because the answer does not contain the number $15$, only its digits. However, any $4$ or $8$ will invalidate the bonus.
If the code does not contain any digit at all, reduce your score by 50%. Other characters like $ù$, $ò$ or $ó$ are still valid for this bonus.
number code-challenge integer
 |Â
show 3 more comments
up vote
1
down vote
favorite
As a big fan of the Lost TV series, I always got intrigued by the sequence of numbers that repetitively appears on the episodes. These numbers are:
$ 4, 8, 15, 16, 23, 42$ (A104101)
Using any programming language, write a code that outputs these numbers.
Scoring:
Shortest answer wins
The output must not contain any other numbers or letters. You may use any other character as separator, or even no separator at all.
You cannot separate digits of the same number. $ 48_15162342 $ is a valid answer, but $481_5162342$ is not.
You must respect the order.
If your code does not contain any of the numbers from the sequence, reduce your score by 30%. This rule does allow you to enter the digits separately. E.g.:
abcde1fg5h
Is a valid candidate because the answer does not contain the number $15$, only its digits. However, any $4$ or $8$ will invalidate the bonus.
If the code does not contain any digit at all, reduce your score by 50%. Other characters like $ù$, $ò$ or $ó$ are still valid for this bonus.
number code-challenge integer
3
I'm tagging the win condition as code challenge, since the score is a function of code length and whether the code omits certain characters.
â xnor
20 hours ago
1
If we use no separator, the numbers will be run together like4815162342
. Is that OK?
â xnor
20 hours ago
2
Related, closed question: codegolf.stackexchange.com/q/23808/67312
â Giuseppe
20 hours ago
2
Vaguely related: Are you lost yet?
â Dennisâ¦
20 hours ago
3
For future reference, we have arestricted-source
tag that could have been used here: although most answers are avoiding obvious solutions, I think the challenge would have been slightly more interesting if using digits were forbidden altogether.
â Arnauld
10 hours ago
 |Â
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
As a big fan of the Lost TV series, I always got intrigued by the sequence of numbers that repetitively appears on the episodes. These numbers are:
$ 4, 8, 15, 16, 23, 42$ (A104101)
Using any programming language, write a code that outputs these numbers.
Scoring:
Shortest answer wins
The output must not contain any other numbers or letters. You may use any other character as separator, or even no separator at all.
You cannot separate digits of the same number. $ 48_15162342 $ is a valid answer, but $481_5162342$ is not.
You must respect the order.
If your code does not contain any of the numbers from the sequence, reduce your score by 30%. This rule does allow you to enter the digits separately. E.g.:
abcde1fg5h
Is a valid candidate because the answer does not contain the number $15$, only its digits. However, any $4$ or $8$ will invalidate the bonus.
If the code does not contain any digit at all, reduce your score by 50%. Other characters like $ù$, $ò$ or $ó$ are still valid for this bonus.
number code-challenge integer
As a big fan of the Lost TV series, I always got intrigued by the sequence of numbers that repetitively appears on the episodes. These numbers are:
$ 4, 8, 15, 16, 23, 42$ (A104101)
Using any programming language, write a code that outputs these numbers.
Scoring:
Shortest answer wins
The output must not contain any other numbers or letters. You may use any other character as separator, or even no separator at all.
You cannot separate digits of the same number. $ 48_15162342 $ is a valid answer, but $481_5162342$ is not.
You must respect the order.
If your code does not contain any of the numbers from the sequence, reduce your score by 30%. This rule does allow you to enter the digits separately. E.g.:
abcde1fg5h
Is a valid candidate because the answer does not contain the number $15$, only its digits. However, any $4$ or $8$ will invalidate the bonus.
If the code does not contain any digit at all, reduce your score by 50%. Other characters like $ù$, $ò$ or $ó$ are still valid for this bonus.
number code-challenge integer
number code-challenge integer
edited 10 mins ago
Jo King
18.3k241100
18.3k241100
asked 20 hours ago
Eduardo Hoefel
1769
1769
3
I'm tagging the win condition as code challenge, since the score is a function of code length and whether the code omits certain characters.
â xnor
20 hours ago
1
If we use no separator, the numbers will be run together like4815162342
. Is that OK?
â xnor
20 hours ago
2
Related, closed question: codegolf.stackexchange.com/q/23808/67312
â Giuseppe
20 hours ago
2
Vaguely related: Are you lost yet?
â Dennisâ¦
20 hours ago
3
For future reference, we have arestricted-source
tag that could have been used here: although most answers are avoiding obvious solutions, I think the challenge would have been slightly more interesting if using digits were forbidden altogether.
â Arnauld
10 hours ago
 |Â
show 3 more comments
3
I'm tagging the win condition as code challenge, since the score is a function of code length and whether the code omits certain characters.
â xnor
20 hours ago
1
If we use no separator, the numbers will be run together like4815162342
. Is that OK?
â xnor
20 hours ago
2
Related, closed question: codegolf.stackexchange.com/q/23808/67312
â Giuseppe
20 hours ago
2
Vaguely related: Are you lost yet?
â Dennisâ¦
20 hours ago
3
For future reference, we have arestricted-source
tag that could have been used here: although most answers are avoiding obvious solutions, I think the challenge would have been slightly more interesting if using digits were forbidden altogether.
â Arnauld
10 hours ago
3
3
I'm tagging the win condition as code challenge, since the score is a function of code length and whether the code omits certain characters.
â xnor
20 hours ago
I'm tagging the win condition as code challenge, since the score is a function of code length and whether the code omits certain characters.
â xnor
20 hours ago
1
1
If we use no separator, the numbers will be run together like
4815162342
. Is that OK?â xnor
20 hours ago
If we use no separator, the numbers will be run together like
4815162342
. Is that OK?â xnor
20 hours ago
2
2
Related, closed question: codegolf.stackexchange.com/q/23808/67312
â Giuseppe
20 hours ago
Related, closed question: codegolf.stackexchange.com/q/23808/67312
â Giuseppe
20 hours ago
2
2
Vaguely related: Are you lost yet?
â Dennisâ¦
20 hours ago
Vaguely related: Are you lost yet?
â Dennisâ¦
20 hours ago
3
3
For future reference, we have a
restricted-source
tag that could have been used here: although most answers are avoiding obvious solutions, I think the challenge would have been slightly more interesting if using digits were forbidden altogether.â Arnauld
10 hours ago
For future reference, we have a
restricted-source
tag that could have been used here: although most answers are avoiding obvious solutions, I think the challenge would have been slightly more interesting if using digits were forbidden altogether.â Arnauld
10 hours ago
 |Â
show 3 more comments
20 Answers
20
active
oldest
votes
up vote
11
down vote
Lost, 29 27/2 = 13.5 bytes
%?>>>>>>>>>>
>>"*"@"
Try it online! or verify that it is deterministic
Seemed like the right language to use.
Explanation:
Lost is a 2D language where the pointer starts anywhere, going in any direction. This generally leads to a lot of double checking that the pointer hasn't entered a section early.
...>>>>>>>>>> These arrows filter all pointers that appear on the top line
............. Or going vertically
%............ This flips the flag so that the program can end
............. This stops premature termination
.?.......... Clear the stack by skipping if a value popped from the stack is positive
............. When the stack is empty, the directs the pointer down
............. The directs the pointer right
.."*".. The string literal pushes all the Lost values to the stack
............ The @ terminates the program if the % flag is switched
>>........@. Otherwise it clears the stack and repeats
............. The quote here is to prevent the pointer getting stuck
............" This happens when the pointer starts between the other quotes
add a comment |Â
up vote
5
down vote
Jelly, 7/2 = 3.5 bytes
âÂÂòÃÂIÃ¥âÂÂḤ
Prints the numbers without separator, i.e., the integer $4815162342$.
Try it online!
How it works
âÂÂòÃÂIÃ¥âÂÂ
is bijective base-250 integer literal.ò
, ÃÂ
, I
, and ÃÂ¥
have (1-based) indices $154$, $21$, $74$, and $171$ in Jelly's code page, so they encode the integer $250^3cdot154+250^2cdot21+250cdot74+171=2407581171$.
Finally, Ḥ
(unhalve) doubles the integer, yielding $2cdot2407581171=4815162342$.
Doubling is necessary, because encoding the output directly leads to âÂÂá9)ÃÂ[âÂÂ
, which contains a digit.
add a comment |Â
up vote
5
down vote
Python 3, 29 bytes, 14.5 points
print(ord('𩦦')*ord('湡'))
Try it online!
𩦦 ï¼Â⿰馬è¬@is variant character of é« which means "dirty". 湡 is the name of a river. And they are nothing related to this question as I known.
I asked about separator rules and we can use any individual separator which makes4815 162342
valid. Thusprint(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).
â Jonathan Allan
2 hours ago
add a comment |Â
up vote
3
down vote
05AB1E, score: 10 9 7 bytes / 2 = 3.5
â¢âÂÂo]ÃÂâ¢÷
Try it online.
Or 7 bytes alternative:
â¢âÂÂõ[%â¢R
Try it online.
Both outputting the integer 4815162342
.
Explanation:
â¢âÂÂo]ÃÂ⢠# Compressed integer 2407581171
÷ # Doubled
â¢âÂÂõ[%⢠# Compressed integer 2432615184
R # Reversed
See this 05AB1E tip of mine (section How to compress large integers?) to understand why â¢âÂÂo]ÃÂâ¢
is 2407581171
and â¢âÂÂõ[%â¢
is 2432615184
.
Old 9 bytes answer outputting the list [4,8,15,16,23,42]
:
â¢ÃÂÃÂÃÂòâ¢ÃÂ;ò
-1 byte (and therefore -0.5 score) thanks to @Emigna.
Longer than the other 05AB1E answer, but this outputs the list [4,8,15,16,23,42]
instead of the integer 4815162342
.
Try it online.
Explanation:
â¢ÃÂÃÂÃÂò⢠# Compressed integer 1301916192
ÃÂ; # Integer 50 (100 halved)
ò # Convert the first integer to Base-50 (arbitrary): [4,8,15,16,23,42]
See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer-lists?) to understand why â¢ÃÂÃÂÃÂòâ¢
is 1301916192
, and â¢ÃÂÃÂÃÂòâ¢50ò
is [4,8,15,16,23,42]
.
1
You could haveâ¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.
â Emigna
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
2
down vote
Charcoal, 13 bytes / 2 = 6.5
IETPIHA.âÂȉ¸â¸âÂÂ
ù
Try it online! Link is to verbose version of code. Works by subtracting the ASCII codes of the string TPIHA.
from 88 and casting to string.
add a comment |Â
up vote
2
down vote
Brain-Flak, 52/2 == 26 bytes
(((((((((()()()()))))[()])())()()()))[]())
Try it online!
add a comment |Â
up vote
2
down vote
05AB1E, 6*0.7 = 4.2 bytes
â¢1Z&ðâÂÂ
Try it online!
Prints the number uncompressed from base-255
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
2
down vote
JavaScript (ES7), 34/2 = 17 bytes
_=>eval(atob`NjUwNTgxMDArNDEqKjY`)
Try it online!
This decodes and evaluates the expression "65058100+41**6"
, which does not contain any digit once encoded in base-64.
$$65058100+41^6=65058100+4750104241=4815162341$$
JavaScript (ES6), 13 bytes
Boring obvious solution.
_=>4815162341
Try it online!
add a comment |Â
up vote
2
down vote
Java 8, score: 24 bytes / 2 = 12
v->(long)''*'âÂÂ'*'䧶'
Contains an unprintable character 0x1B
.
Try it online.
Explanation:
v-> // Method with empty unused parameter and long return-type
(long) // Cast the character (and therefore the result) to a long
'' // 27
*'âÂÂ' // Multiplied by 9419
*'䧶' // Multiplied by 18934
In Java, characters can be autoboxed to integers holding their unicode value. Unfortunately, the maximum supported unicode for characters is 65,535
, so I can't use just two characters to multiply (since the largest two numbers that divide the expected 4,815,162,342
are 56,802
and 84,771
, where the 84,771
unfortunately exceeds the maximum 65,535
.
In addition, since the maximum size of an int
is 322-1 (2,147,483,647
) and the result 4,815,162,342
is larger than that, an explicit cast to long
, which can hold up to 642-1 (9,223,372,036,854,775,807
), is required.
Boring answer would have been 14 bytes without any bonuses:
v->4815162341L
Try it online.
1
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
@Emigna Thanks. It's too bad it requires the cast tolong
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, justv->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.
â Kevin Cruijssen
11 hours ago
add a comment |Â
up vote
2
down vote
Neim, 6 5 bytes, 3 2.5 points
JÃÂÃÂçA
Explanation:
J Push 48
ÃÂ Push 15
ÃÂ Push 16
ç Push 23
A Push 42
Implicitly join the contents
of the stack together and print
Try it online!
add a comment |Â
up vote
1
down vote
JavaScript, 143 bytes (not sure how to score)
(g=`$2*2`)=>g.repeat(6).replace(/(.)/g,(m,p,i,k='')=>
(k=m*[g-3,g-2,g,g,+g+2,g*3-1][i]
,RegExp(`$g-2|$g`).test(i)?k-1:i==+g+1?k-(g/2):k))
Try it online!
Start with six 4
's, multiply, add, subtract by, to, from 4
to derive output.
2
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number4
, with addition, subtraction, multiplication and the index of the number4
within a string (or array) can be used to derive the required numbers.
â guest271314
19 hours ago
Your score is143*0.7=100.1
â Jo King
19 hours ago
add a comment |Â
up vote
1
down vote
PHP, 35/2=17.5
<?=zzzzzzzzzzzzzzz^NVBVKOVKLVHIVNH;
a digital approach: 40*.7=28
<?=2+2,_,5+3,_,17-2,_,17-1,_,17+6,_,7*6;
no digits, no strings: 68/2 = 34
<?=$p++,!$p++,$p+=$p,_,$p+=$p,_,~-$q=$p+$p,_,$q,_,--$p+$q,_,$p*~-$p;
Try them online.
1
Or just 14 bytes for<?=4815162342;
â Jo King
13 hours ago
1
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:4815162342
. Or<?=~
+ 10 unprintables -> 15/2=7.5
â Titus
7 hours ago
add a comment |Â
up vote
1
down vote
Japt, 10 bytes / 2 = 5
"óT"mc w
Test it
add a comment |Â
up vote
1
down vote
JavaScript (SpiderMonkey), 67 bytes / 2 = 33.5 60 bytes / 2 = 30 58 bytes / 2 = 29 48 bytes / 2 = 24
-7 bytes/3.5, -2 bytes/1 courtesy of @JoKing, -10 bytes/5 courtesy of @tsh
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
Try it online!
1
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
Or justprint(4815162342)
for 17 bytes
â Jo King
13 hours ago
add a comment |Â
up vote
0
down vote
Python 2, 16 bytes
print 4815162342
Try it online!
add a comment |Â
up vote
0
down vote
perl -M5.010 -Mre=eval, 32/2 == 16 bytes
This program is mostly unprintable characters -- characters which aren't even Unicode characters. Here is a hexdump of the program:
$ od -x solution
0000000 2727 7e3d 277e c0d7 8c84 869e cbd8 c7d3
0000020 ced3 d3ca c9ce cdd3 d3cc cdcb 82d8 27d6
0000040
$
And here's the program to create the solution:
#!/opt/perl/bin/perl
use 5.026;
use strict;
use warnings;
no warnings 'syntax';
use experimental 'signatures';
my $q = ~"(?say'4,8,15,16,23,42')";
print "''=~~'$q'";
__END__
add a comment |Â
up vote
0
down vote
Red, 50 bytes / 2 = 25
foreach c"abcdcefgaf"[prin index? find"cfgade.b"c]
Try it online!
Prints the numbers without separator
add a comment |Â
up vote
0
down vote
APL(Dyalog Unicode), 18/2 = 9 bytes
ÃÂ/âÂÂUCS'𩦦湡'
Just boring old character multiplication.
Try it online!
The byte count is 18 in UTF-8. Neither𩦦
nor湡
exist in any APL code page, as far as I know.
â Dennisâ¦
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
add a comment |Â
up vote
0
down vote
Whitespace, score: 49 bytes / 2 = 24.5
[S S S T T S T T T S T T T T S S S T S N
_Push_56802][S S S T S T S S T S T T S S T S S S T T N
_Push_84771][T S S N
_Multiply][T N
S T _Print_as_integer]
Letters S
(space), T
(tab), and N
(new-line) added as highlighting only.[..._some_action]
added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Pseudo-code:
Integer i = 56802
Integer j = 84771
Integer k = i * j
Print k as number to STDOUT
add a comment |Â
up vote
0
down vote
Z80Golf, 17 bytes * 0.5 = 8.5
00000000: 1b17 1e1a 1e19 1d1c 1b1d 2676 0a03 c5ee ..........&v....
00000010: 2f /
Try it online!
Assembly:
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '8' ;17 rla
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '5' ;1a 0x1a
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '6' ;19 0x19
db 0x2F ^ '2' ;1d dec e
db 0x2F ^ '3' ;1c inc e
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '2' ;1d dec e
ld h, 0x76 ;halt
ld a, (bc) ;load the next digit. The first char in addr in 0x0
inc bc ;get next digit
push bc ;return to the next digit which is basically a nop
xor 0x2F ;decode the digit
;fall through into putchar. Putchar (0x8000), prints the char in register a
Assembly
add a comment |Â
20 Answers
20
active
oldest
votes
20 Answers
20
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
11
down vote
Lost, 29 27/2 = 13.5 bytes
%?>>>>>>>>>>
>>"*"@"
Try it online! or verify that it is deterministic
Seemed like the right language to use.
Explanation:
Lost is a 2D language where the pointer starts anywhere, going in any direction. This generally leads to a lot of double checking that the pointer hasn't entered a section early.
...>>>>>>>>>> These arrows filter all pointers that appear on the top line
............. Or going vertically
%............ This flips the flag so that the program can end
............. This stops premature termination
.?.......... Clear the stack by skipping if a value popped from the stack is positive
............. When the stack is empty, the directs the pointer down
............. The directs the pointer right
.."*".. The string literal pushes all the Lost values to the stack
............ The @ terminates the program if the % flag is switched
>>........@. Otherwise it clears the stack and repeats
............. The quote here is to prevent the pointer getting stuck
............" This happens when the pointer starts between the other quotes
add a comment |Â
up vote
11
down vote
Lost, 29 27/2 = 13.5 bytes
%?>>>>>>>>>>
>>"*"@"
Try it online! or verify that it is deterministic
Seemed like the right language to use.
Explanation:
Lost is a 2D language where the pointer starts anywhere, going in any direction. This generally leads to a lot of double checking that the pointer hasn't entered a section early.
...>>>>>>>>>> These arrows filter all pointers that appear on the top line
............. Or going vertically
%............ This flips the flag so that the program can end
............. This stops premature termination
.?.......... Clear the stack by skipping if a value popped from the stack is positive
............. When the stack is empty, the directs the pointer down
............. The directs the pointer right
.."*".. The string literal pushes all the Lost values to the stack
............ The @ terminates the program if the % flag is switched
>>........@. Otherwise it clears the stack and repeats
............. The quote here is to prevent the pointer getting stuck
............" This happens when the pointer starts between the other quotes
add a comment |Â
up vote
11
down vote
up vote
11
down vote
Lost, 29 27/2 = 13.5 bytes
%?>>>>>>>>>>
>>"*"@"
Try it online! or verify that it is deterministic
Seemed like the right language to use.
Explanation:
Lost is a 2D language where the pointer starts anywhere, going in any direction. This generally leads to a lot of double checking that the pointer hasn't entered a section early.
...>>>>>>>>>> These arrows filter all pointers that appear on the top line
............. Or going vertically
%............ This flips the flag so that the program can end
............. This stops premature termination
.?.......... Clear the stack by skipping if a value popped from the stack is positive
............. When the stack is empty, the directs the pointer down
............. The directs the pointer right
.."*".. The string literal pushes all the Lost values to the stack
............ The @ terminates the program if the % flag is switched
>>........@. Otherwise it clears the stack and repeats
............. The quote here is to prevent the pointer getting stuck
............" This happens when the pointer starts between the other quotes
Lost, 29 27/2 = 13.5 bytes
%?>>>>>>>>>>
>>"*"@"
Try it online! or verify that it is deterministic
Seemed like the right language to use.
Explanation:
Lost is a 2D language where the pointer starts anywhere, going in any direction. This generally leads to a lot of double checking that the pointer hasn't entered a section early.
...>>>>>>>>>> These arrows filter all pointers that appear on the top line
............. Or going vertically
%............ This flips the flag so that the program can end
............. This stops premature termination
.?.......... Clear the stack by skipping if a value popped from the stack is positive
............. When the stack is empty, the directs the pointer down
............. The directs the pointer right
.."*".. The string literal pushes all the Lost values to the stack
............ The @ terminates the program if the % flag is switched
>>........@. Otherwise it clears the stack and repeats
............. The quote here is to prevent the pointer getting stuck
............" This happens when the pointer starts between the other quotes
edited 12 hours ago
answered 20 hours ago
Jo King
18.3k241100
18.3k241100
add a comment |Â
add a comment |Â
up vote
5
down vote
Jelly, 7/2 = 3.5 bytes
âÂÂòÃÂIÃ¥âÂÂḤ
Prints the numbers without separator, i.e., the integer $4815162342$.
Try it online!
How it works
âÂÂòÃÂIÃ¥âÂÂ
is bijective base-250 integer literal.ò
, ÃÂ
, I
, and ÃÂ¥
have (1-based) indices $154$, $21$, $74$, and $171$ in Jelly's code page, so they encode the integer $250^3cdot154+250^2cdot21+250cdot74+171=2407581171$.
Finally, Ḥ
(unhalve) doubles the integer, yielding $2cdot2407581171=4815162342$.
Doubling is necessary, because encoding the output directly leads to âÂÂá9)ÃÂ[âÂÂ
, which contains a digit.
add a comment |Â
up vote
5
down vote
Jelly, 7/2 = 3.5 bytes
âÂÂòÃÂIÃ¥âÂÂḤ
Prints the numbers without separator, i.e., the integer $4815162342$.
Try it online!
How it works
âÂÂòÃÂIÃ¥âÂÂ
is bijective base-250 integer literal.ò
, ÃÂ
, I
, and ÃÂ¥
have (1-based) indices $154$, $21$, $74$, and $171$ in Jelly's code page, so they encode the integer $250^3cdot154+250^2cdot21+250cdot74+171=2407581171$.
Finally, Ḥ
(unhalve) doubles the integer, yielding $2cdot2407581171=4815162342$.
Doubling is necessary, because encoding the output directly leads to âÂÂá9)ÃÂ[âÂÂ
, which contains a digit.
add a comment |Â
up vote
5
down vote
up vote
5
down vote
Jelly, 7/2 = 3.5 bytes
âÂÂòÃÂIÃ¥âÂÂḤ
Prints the numbers without separator, i.e., the integer $4815162342$.
Try it online!
How it works
âÂÂòÃÂIÃ¥âÂÂ
is bijective base-250 integer literal.ò
, ÃÂ
, I
, and ÃÂ¥
have (1-based) indices $154$, $21$, $74$, and $171$ in Jelly's code page, so they encode the integer $250^3cdot154+250^2cdot21+250cdot74+171=2407581171$.
Finally, Ḥ
(unhalve) doubles the integer, yielding $2cdot2407581171=4815162342$.
Doubling is necessary, because encoding the output directly leads to âÂÂá9)ÃÂ[âÂÂ
, which contains a digit.
Jelly, 7/2 = 3.5 bytes
âÂÂòÃÂIÃ¥âÂÂḤ
Prints the numbers without separator, i.e., the integer $4815162342$.
Try it online!
How it works
âÂÂòÃÂIÃ¥âÂÂ
is bijective base-250 integer literal.ò
, ÃÂ
, I
, and ÃÂ¥
have (1-based) indices $154$, $21$, $74$, and $171$ in Jelly's code page, so they encode the integer $250^3cdot154+250^2cdot21+250cdot74+171=2407581171$.
Finally, Ḥ
(unhalve) doubles the integer, yielding $2cdot2407581171=4815162342$.
Doubling is necessary, because encoding the output directly leads to âÂÂá9)ÃÂ[âÂÂ
, which contains a digit.
edited 20 hours ago
answered 20 hours ago
Dennisâ¦
183k32293726
183k32293726
add a comment |Â
add a comment |Â
up vote
5
down vote
Python 3, 29 bytes, 14.5 points
print(ord('𩦦')*ord('湡'))
Try it online!
𩦦 ï¼Â⿰馬è¬@is variant character of é« which means "dirty". 湡 is the name of a river. And they are nothing related to this question as I known.
I asked about separator rules and we can use any individual separator which makes4815 162342
valid. Thusprint(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).
â Jonathan Allan
2 hours ago
add a comment |Â
up vote
5
down vote
Python 3, 29 bytes, 14.5 points
print(ord('𩦦')*ord('湡'))
Try it online!
𩦦 ï¼Â⿰馬è¬@is variant character of é« which means "dirty". 湡 is the name of a river. And they are nothing related to this question as I known.
I asked about separator rules and we can use any individual separator which makes4815 162342
valid. Thusprint(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).
â Jonathan Allan
2 hours ago
add a comment |Â
up vote
5
down vote
up vote
5
down vote
Python 3, 29 bytes, 14.5 points
print(ord('𩦦')*ord('湡'))
Try it online!
𩦦 ï¼Â⿰馬è¬@is variant character of é« which means "dirty". 湡 is the name of a river. And they are nothing related to this question as I known.
Python 3, 29 bytes, 14.5 points
print(ord('𩦦')*ord('湡'))
Try it online!
𩦦 ï¼Â⿰馬è¬@is variant character of é« which means "dirty". 湡 is the name of a river. And they are nothing related to this question as I known.
edited 9 hours ago
answered 14 hours ago
tsh
8,03611346
8,03611346
I asked about separator rules and we can use any individual separator which makes4815 162342
valid. Thusprint(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).
â Jonathan Allan
2 hours ago
add a comment |Â
I asked about separator rules and we can use any individual separator which makes4815 162342
valid. Thusprint(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).
â Jonathan Allan
2 hours ago
I asked about separator rules and we can use any individual separator which makes
4815 162342
valid. Thus print(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).â Jonathan Allan
2 hours ago
I asked about separator rules and we can use any individual separator which makes
4815 162342
valid. Thus print(*map(ord,'áÂÂ𧨦'))
saves 1.5 points :) (print(*map(ord,'ë°ÂïÂÂ'))
would save 2 points but has been specified as invalid).â Jonathan Allan
2 hours ago
add a comment |Â
up vote
3
down vote
05AB1E, score: 10 9 7 bytes / 2 = 3.5
â¢âÂÂo]ÃÂâ¢÷
Try it online.
Or 7 bytes alternative:
â¢âÂÂõ[%â¢R
Try it online.
Both outputting the integer 4815162342
.
Explanation:
â¢âÂÂo]ÃÂ⢠# Compressed integer 2407581171
÷ # Doubled
â¢âÂÂõ[%⢠# Compressed integer 2432615184
R # Reversed
See this 05AB1E tip of mine (section How to compress large integers?) to understand why â¢âÂÂo]ÃÂâ¢
is 2407581171
and â¢âÂÂõ[%â¢
is 2432615184
.
Old 9 bytes answer outputting the list [4,8,15,16,23,42]
:
â¢ÃÂÃÂÃÂòâ¢ÃÂ;ò
-1 byte (and therefore -0.5 score) thanks to @Emigna.
Longer than the other 05AB1E answer, but this outputs the list [4,8,15,16,23,42]
instead of the integer 4815162342
.
Try it online.
Explanation:
â¢ÃÂÃÂÃÂò⢠# Compressed integer 1301916192
ÃÂ; # Integer 50 (100 halved)
ò # Convert the first integer to Base-50 (arbitrary): [4,8,15,16,23,42]
See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer-lists?) to understand why â¢ÃÂÃÂÃÂòâ¢
is 1301916192
, and â¢ÃÂÃÂÃÂòâ¢50ò
is [4,8,15,16,23,42]
.
1
You could haveâ¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.
â Emigna
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
3
down vote
05AB1E, score: 10 9 7 bytes / 2 = 3.5
â¢âÂÂo]ÃÂâ¢÷
Try it online.
Or 7 bytes alternative:
â¢âÂÂõ[%â¢R
Try it online.
Both outputting the integer 4815162342
.
Explanation:
â¢âÂÂo]ÃÂ⢠# Compressed integer 2407581171
÷ # Doubled
â¢âÂÂõ[%⢠# Compressed integer 2432615184
R # Reversed
See this 05AB1E tip of mine (section How to compress large integers?) to understand why â¢âÂÂo]ÃÂâ¢
is 2407581171
and â¢âÂÂõ[%â¢
is 2432615184
.
Old 9 bytes answer outputting the list [4,8,15,16,23,42]
:
â¢ÃÂÃÂÃÂòâ¢ÃÂ;ò
-1 byte (and therefore -0.5 score) thanks to @Emigna.
Longer than the other 05AB1E answer, but this outputs the list [4,8,15,16,23,42]
instead of the integer 4815162342
.
Try it online.
Explanation:
â¢ÃÂÃÂÃÂò⢠# Compressed integer 1301916192
ÃÂ; # Integer 50 (100 halved)
ò # Convert the first integer to Base-50 (arbitrary): [4,8,15,16,23,42]
See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer-lists?) to understand why â¢ÃÂÃÂÃÂòâ¢
is 1301916192
, and â¢ÃÂÃÂÃÂòâ¢50ò
is [4,8,15,16,23,42]
.
1
You could haveâ¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.
â Emigna
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
05AB1E, score: 10 9 7 bytes / 2 = 3.5
â¢âÂÂo]ÃÂâ¢÷
Try it online.
Or 7 bytes alternative:
â¢âÂÂõ[%â¢R
Try it online.
Both outputting the integer 4815162342
.
Explanation:
â¢âÂÂo]ÃÂ⢠# Compressed integer 2407581171
÷ # Doubled
â¢âÂÂõ[%⢠# Compressed integer 2432615184
R # Reversed
See this 05AB1E tip of mine (section How to compress large integers?) to understand why â¢âÂÂo]ÃÂâ¢
is 2407581171
and â¢âÂÂõ[%â¢
is 2432615184
.
Old 9 bytes answer outputting the list [4,8,15,16,23,42]
:
â¢ÃÂÃÂÃÂòâ¢ÃÂ;ò
-1 byte (and therefore -0.5 score) thanks to @Emigna.
Longer than the other 05AB1E answer, but this outputs the list [4,8,15,16,23,42]
instead of the integer 4815162342
.
Try it online.
Explanation:
â¢ÃÂÃÂÃÂò⢠# Compressed integer 1301916192
ÃÂ; # Integer 50 (100 halved)
ò # Convert the first integer to Base-50 (arbitrary): [4,8,15,16,23,42]
See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer-lists?) to understand why â¢ÃÂÃÂÃÂòâ¢
is 1301916192
, and â¢ÃÂÃÂÃÂòâ¢50ò
is [4,8,15,16,23,42]
.
05AB1E, score: 10 9 7 bytes / 2 = 3.5
â¢âÂÂo]ÃÂâ¢÷
Try it online.
Or 7 bytes alternative:
â¢âÂÂõ[%â¢R
Try it online.
Both outputting the integer 4815162342
.
Explanation:
â¢âÂÂo]ÃÂ⢠# Compressed integer 2407581171
÷ # Doubled
â¢âÂÂõ[%⢠# Compressed integer 2432615184
R # Reversed
See this 05AB1E tip of mine (section How to compress large integers?) to understand why â¢âÂÂo]ÃÂâ¢
is 2407581171
and â¢âÂÂõ[%â¢
is 2432615184
.
Old 9 bytes answer outputting the list [4,8,15,16,23,42]
:
â¢ÃÂÃÂÃÂòâ¢ÃÂ;ò
-1 byte (and therefore -0.5 score) thanks to @Emigna.
Longer than the other 05AB1E answer, but this outputs the list [4,8,15,16,23,42]
instead of the integer 4815162342
.
Try it online.
Explanation:
â¢ÃÂÃÂÃÂò⢠# Compressed integer 1301916192
ÃÂ; # Integer 50 (100 halved)
ò # Convert the first integer to Base-50 (arbitrary): [4,8,15,16,23,42]
See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer-lists?) to understand why â¢ÃÂÃÂÃÂòâ¢
is 1301916192
, and â¢ÃÂÃÂÃÂòâ¢50ò
is [4,8,15,16,23,42]
.
edited 11 hours ago
answered 12 hours ago
Kevin Cruijssen
32.9k554176
32.9k554176
1
You could haveâ¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.
â Emigna
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
add a comment |Â
1
You could haveâ¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.
â Emigna
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
1
1
You could have
â¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.â Emigna
12 hours ago
You could have
â¢ÃÂÃÂòâ¢ÃÂ;ò
for 4.5 as post-script numbers are okay for the bonus.â Emigna
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
@Emigna Ah, nice! Thanks.
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
2
down vote
Charcoal, 13 bytes / 2 = 6.5
IETPIHA.âÂȉ¸â¸âÂÂ
ù
Try it online! Link is to verbose version of code. Works by subtracting the ASCII codes of the string TPIHA.
from 88 and casting to string.
add a comment |Â
up vote
2
down vote
Charcoal, 13 bytes / 2 = 6.5
IETPIHA.âÂȉ¸â¸âÂÂ
ù
Try it online! Link is to verbose version of code. Works by subtracting the ASCII codes of the string TPIHA.
from 88 and casting to string.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Charcoal, 13 bytes / 2 = 6.5
IETPIHA.âÂȉ¸â¸âÂÂ
ù
Try it online! Link is to verbose version of code. Works by subtracting the ASCII codes of the string TPIHA.
from 88 and casting to string.
Charcoal, 13 bytes / 2 = 6.5
IETPIHA.âÂȉ¸â¸âÂÂ
ù
Try it online! Link is to verbose version of code. Works by subtracting the ASCII codes of the string TPIHA.
from 88 and casting to string.
answered 20 hours ago
Neil
77.3k744174
77.3k744174
add a comment |Â
add a comment |Â
up vote
2
down vote
Brain-Flak, 52/2 == 26 bytes
(((((((((()()()()))))[()])())()()()))[]())
Try it online!
add a comment |Â
up vote
2
down vote
Brain-Flak, 52/2 == 26 bytes
(((((((((()()()()))))[()])())()()()))[]())
Try it online!
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Brain-Flak, 52/2 == 26 bytes
(((((((((()()()()))))[()])())()()()))[]())
Try it online!
Brain-Flak, 52/2 == 26 bytes
(((((((((()()()()))))[()])())()()()))[]())
Try it online!
answered 16 hours ago
DJMcMayhemâ¦
40.5k11143307
40.5k11143307
add a comment |Â
add a comment |Â
up vote
2
down vote
05AB1E, 6*0.7 = 4.2 bytes
â¢1Z&ðâÂÂ
Try it online!
Prints the number uncompressed from base-255
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
2
down vote
05AB1E, 6*0.7 = 4.2 bytes
â¢1Z&ðâÂÂ
Try it online!
Prints the number uncompressed from base-255
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
05AB1E, 6*0.7 = 4.2 bytes
â¢1Z&ðâÂÂ
Try it online!
Prints the number uncompressed from base-255
05AB1E, 6*0.7 = 4.2 bytes
â¢1Z&ðâÂÂ
Try it online!
Prints the number uncompressed from base-255
answered 14 hours ago
Emigna
44.2k431133
44.2k431133
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
add a comment |Â
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
You beat me to it. ;)
â Kevin Cruijssen
12 hours ago
add a comment |Â
up vote
2
down vote
JavaScript (ES7), 34/2 = 17 bytes
_=>eval(atob`NjUwNTgxMDArNDEqKjY`)
Try it online!
This decodes and evaluates the expression "65058100+41**6"
, which does not contain any digit once encoded in base-64.
$$65058100+41^6=65058100+4750104241=4815162341$$
JavaScript (ES6), 13 bytes
Boring obvious solution.
_=>4815162341
Try it online!
add a comment |Â
up vote
2
down vote
JavaScript (ES7), 34/2 = 17 bytes
_=>eval(atob`NjUwNTgxMDArNDEqKjY`)
Try it online!
This decodes and evaluates the expression "65058100+41**6"
, which does not contain any digit once encoded in base-64.
$$65058100+41^6=65058100+4750104241=4815162341$$
JavaScript (ES6), 13 bytes
Boring obvious solution.
_=>4815162341
Try it online!
add a comment |Â
up vote
2
down vote
up vote
2
down vote
JavaScript (ES7), 34/2 = 17 bytes
_=>eval(atob`NjUwNTgxMDArNDEqKjY`)
Try it online!
This decodes and evaluates the expression "65058100+41**6"
, which does not contain any digit once encoded in base-64.
$$65058100+41^6=65058100+4750104241=4815162341$$
JavaScript (ES6), 13 bytes
Boring obvious solution.
_=>4815162341
Try it online!
JavaScript (ES7), 34/2 = 17 bytes
_=>eval(atob`NjUwNTgxMDArNDEqKjY`)
Try it online!
This decodes and evaluates the expression "65058100+41**6"
, which does not contain any digit once encoded in base-64.
$$65058100+41^6=65058100+4750104241=4815162341$$
JavaScript (ES6), 13 bytes
Boring obvious solution.
_=>4815162341
Try it online!
edited 11 hours ago
answered 11 hours ago
Arnauld
67.3k584283
67.3k584283
add a comment |Â
add a comment |Â
up vote
2
down vote
Java 8, score: 24 bytes / 2 = 12
v->(long)''*'âÂÂ'*'䧶'
Contains an unprintable character 0x1B
.
Try it online.
Explanation:
v-> // Method with empty unused parameter and long return-type
(long) // Cast the character (and therefore the result) to a long
'' // 27
*'âÂÂ' // Multiplied by 9419
*'䧶' // Multiplied by 18934
In Java, characters can be autoboxed to integers holding their unicode value. Unfortunately, the maximum supported unicode for characters is 65,535
, so I can't use just two characters to multiply (since the largest two numbers that divide the expected 4,815,162,342
are 56,802
and 84,771
, where the 84,771
unfortunately exceeds the maximum 65,535
.
In addition, since the maximum size of an int
is 322-1 (2,147,483,647
) and the result 4,815,162,342
is larger than that, an explicit cast to long
, which can hold up to 642-1 (9,223,372,036,854,775,807
), is required.
Boring answer would have been 14 bytes without any bonuses:
v->4815162341L
Try it online.
1
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
@Emigna Thanks. It's too bad it requires the cast tolong
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, justv->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.
â Kevin Cruijssen
11 hours ago
add a comment |Â
up vote
2
down vote
Java 8, score: 24 bytes / 2 = 12
v->(long)''*'âÂÂ'*'䧶'
Contains an unprintable character 0x1B
.
Try it online.
Explanation:
v-> // Method with empty unused parameter and long return-type
(long) // Cast the character (and therefore the result) to a long
'' // 27
*'âÂÂ' // Multiplied by 9419
*'䧶' // Multiplied by 18934
In Java, characters can be autoboxed to integers holding their unicode value. Unfortunately, the maximum supported unicode for characters is 65,535
, so I can't use just two characters to multiply (since the largest two numbers that divide the expected 4,815,162,342
are 56,802
and 84,771
, where the 84,771
unfortunately exceeds the maximum 65,535
.
In addition, since the maximum size of an int
is 322-1 (2,147,483,647
) and the result 4,815,162,342
is larger than that, an explicit cast to long
, which can hold up to 642-1 (9,223,372,036,854,775,807
), is required.
Boring answer would have been 14 bytes without any bonuses:
v->4815162341L
Try it online.
1
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
@Emigna Thanks. It's too bad it requires the cast tolong
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, justv->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.
â Kevin Cruijssen
11 hours ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Java 8, score: 24 bytes / 2 = 12
v->(long)''*'âÂÂ'*'䧶'
Contains an unprintable character 0x1B
.
Try it online.
Explanation:
v-> // Method with empty unused parameter and long return-type
(long) // Cast the character (and therefore the result) to a long
'' // 27
*'âÂÂ' // Multiplied by 9419
*'䧶' // Multiplied by 18934
In Java, characters can be autoboxed to integers holding their unicode value. Unfortunately, the maximum supported unicode for characters is 65,535
, so I can't use just two characters to multiply (since the largest two numbers that divide the expected 4,815,162,342
are 56,802
and 84,771
, where the 84,771
unfortunately exceeds the maximum 65,535
.
In addition, since the maximum size of an int
is 322-1 (2,147,483,647
) and the result 4,815,162,342
is larger than that, an explicit cast to long
, which can hold up to 642-1 (9,223,372,036,854,775,807
), is required.
Boring answer would have been 14 bytes without any bonuses:
v->4815162341L
Try it online.
Java 8, score: 24 bytes / 2 = 12
v->(long)''*'âÂÂ'*'䧶'
Contains an unprintable character 0x1B
.
Try it online.
Explanation:
v-> // Method with empty unused parameter and long return-type
(long) // Cast the character (and therefore the result) to a long
'' // 27
*'âÂÂ' // Multiplied by 9419
*'䧶' // Multiplied by 18934
In Java, characters can be autoboxed to integers holding their unicode value. Unfortunately, the maximum supported unicode for characters is 65,535
, so I can't use just two characters to multiply (since the largest two numbers that divide the expected 4,815,162,342
are 56,802
and 84,771
, where the 84,771
unfortunately exceeds the maximum 65,535
.
In addition, since the maximum size of an int
is 322-1 (2,147,483,647
) and the result 4,815,162,342
is larger than that, an explicit cast to long
, which can hold up to 642-1 (9,223,372,036,854,775,807
), is required.
Boring answer would have been 14 bytes without any bonuses:
v->4815162341L
Try it online.
edited 11 hours ago
answered 12 hours ago
Kevin Cruijssen
32.9k554176
32.9k554176
1
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
@Emigna Thanks. It's too bad it requires the cast tolong
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, justv->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.
â Kevin Cruijssen
11 hours ago
add a comment |Â
1
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
@Emigna Thanks. It's too bad it requires the cast tolong
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, justv->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.
â Kevin Cruijssen
11 hours ago
1
1
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
I like this one. Pretty short for being Java :)
â Emigna
11 hours ago
@Emigna Thanks. It's too bad it requires the cast to
long
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, just v->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.â Kevin Cruijssen
11 hours ago
@Emigna Thanks. It's too bad it requires the cast to
long
and doesn't support very large unicode characters. If it weren't for those two restrictions mentioned, just v->'𩦦'*'湡'
(15 bytes, score 7.5) would have been enough. But it's still very short indeed. :) Although Java mostly has many, many weaknesses in terms of codegolfing (duhh..), calculating with characters because we aren't allowed to use digits is one of its few strengths. Was also pretty useful in this rather similar answer of mine.â Kevin Cruijssen
11 hours ago
add a comment |Â
up vote
2
down vote
Neim, 6 5 bytes, 3 2.5 points
JÃÂÃÂçA
Explanation:
J Push 48
ÃÂ Push 15
ÃÂ Push 16
ç Push 23
A Push 42
Implicitly join the contents
of the stack together and print
Try it online!
add a comment |Â
up vote
2
down vote
Neim, 6 5 bytes, 3 2.5 points
JÃÂÃÂçA
Explanation:
J Push 48
ÃÂ Push 15
ÃÂ Push 16
ç Push 23
A Push 42
Implicitly join the contents
of the stack together and print
Try it online!
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Neim, 6 5 bytes, 3 2.5 points
JÃÂÃÂçA
Explanation:
J Push 48
ÃÂ Push 15
ÃÂ Push 16
ç Push 23
A Push 42
Implicitly join the contents
of the stack together and print
Try it online!
Neim, 6 5 bytes, 3 2.5 points
JÃÂÃÂçA
Explanation:
J Push 48
ÃÂ Push 15
ÃÂ Push 16
ç Push 23
A Push 42
Implicitly join the contents
of the stack together and print
Try it online!
edited 6 hours ago
answered 6 hours ago
Okx
12.2k27100
12.2k27100
add a comment |Â
add a comment |Â
up vote
1
down vote
JavaScript, 143 bytes (not sure how to score)
(g=`$2*2`)=>g.repeat(6).replace(/(.)/g,(m,p,i,k='')=>
(k=m*[g-3,g-2,g,g,+g+2,g*3-1][i]
,RegExp(`$g-2|$g`).test(i)?k-1:i==+g+1?k-(g/2):k))
Try it online!
Start with six 4
's, multiply, add, subtract by, to, from 4
to derive output.
2
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number4
, with addition, subtraction, multiplication and the index of the number4
within a string (or array) can be used to derive the required numbers.
â guest271314
19 hours ago
Your score is143*0.7=100.1
â Jo King
19 hours ago
add a comment |Â
up vote
1
down vote
JavaScript, 143 bytes (not sure how to score)
(g=`$2*2`)=>g.repeat(6).replace(/(.)/g,(m,p,i,k='')=>
(k=m*[g-3,g-2,g,g,+g+2,g*3-1][i]
,RegExp(`$g-2|$g`).test(i)?k-1:i==+g+1?k-(g/2):k))
Try it online!
Start with six 4
's, multiply, add, subtract by, to, from 4
to derive output.
2
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number4
, with addition, subtraction, multiplication and the index of the number4
within a string (or array) can be used to derive the required numbers.
â guest271314
19 hours ago
Your score is143*0.7=100.1
â Jo King
19 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
JavaScript, 143 bytes (not sure how to score)
(g=`$2*2`)=>g.repeat(6).replace(/(.)/g,(m,p,i,k='')=>
(k=m*[g-3,g-2,g,g,+g+2,g*3-1][i]
,RegExp(`$g-2|$g`).test(i)?k-1:i==+g+1?k-(g/2):k))
Try it online!
Start with six 4
's, multiply, add, subtract by, to, from 4
to derive output.
JavaScript, 143 bytes (not sure how to score)
(g=`$2*2`)=>g.repeat(6).replace(/(.)/g,(m,p,i,k='')=>
(k=m*[g-3,g-2,g,g,+g+2,g*3-1][i]
,RegExp(`$g-2|$g`).test(i)?k-1:i==+g+1?k-(g/2):k))
Try it online!
Start with six 4
's, multiply, add, subtract by, to, from 4
to derive output.
answered 19 hours ago
guest271314
264211
264211
2
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number4
, with addition, subtraction, multiplication and the index of the number4
within a string (or array) can be used to derive the required numbers.
â guest271314
19 hours ago
Your score is143*0.7=100.1
â Jo King
19 hours ago
add a comment |Â
2
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number4
, with addition, subtraction, multiplication and the index of the number4
within a string (or array) can be used to derive the required numbers.
â guest271314
19 hours ago
Your score is143*0.7=100.1
â Jo King
19 hours ago
2
2
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
Ok, you were trying to get the bonus, but with a code this size, it didn't compensate. Why not simply '4815162342'?
â Eduardo Hoefel
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number
4
, with addition, subtraction, multiplication and the index of the number 4
within a string (or array) can be used to derive the required numbers.â guest271314
19 hours ago
@EduardoHoefel Do not gather the "score" or "bonus" system, did not try to get the bonus, just tried to not use any of the numbers required at output. The code outputs the numbers without hardcoding any of the numbers. The number
4
, with addition, subtraction, multiplication and the index of the number 4
within a string (or array) can be used to derive the required numbers.â guest271314
19 hours ago
Your score is
143*0.7=100.1
â Jo King
19 hours ago
Your score is
143*0.7=100.1
â Jo King
19 hours ago
add a comment |Â
up vote
1
down vote
PHP, 35/2=17.5
<?=zzzzzzzzzzzzzzz^NVBVKOVKLVHIVNH;
a digital approach: 40*.7=28
<?=2+2,_,5+3,_,17-2,_,17-1,_,17+6,_,7*6;
no digits, no strings: 68/2 = 34
<?=$p++,!$p++,$p+=$p,_,$p+=$p,_,~-$q=$p+$p,_,$q,_,--$p+$q,_,$p*~-$p;
Try them online.
1
Or just 14 bytes for<?=4815162342;
â Jo King
13 hours ago
1
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:4815162342
. Or<?=~
+ 10 unprintables -> 15/2=7.5
â Titus
7 hours ago
add a comment |Â
up vote
1
down vote
PHP, 35/2=17.5
<?=zzzzzzzzzzzzzzz^NVBVKOVKLVHIVNH;
a digital approach: 40*.7=28
<?=2+2,_,5+3,_,17-2,_,17-1,_,17+6,_,7*6;
no digits, no strings: 68/2 = 34
<?=$p++,!$p++,$p+=$p,_,$p+=$p,_,~-$q=$p+$p,_,$q,_,--$p+$q,_,$p*~-$p;
Try them online.
1
Or just 14 bytes for<?=4815162342;
â Jo King
13 hours ago
1
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:4815162342
. Or<?=~
+ 10 unprintables -> 15/2=7.5
â Titus
7 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
PHP, 35/2=17.5
<?=zzzzzzzzzzzzzzz^NVBVKOVKLVHIVNH;
a digital approach: 40*.7=28
<?=2+2,_,5+3,_,17-2,_,17-1,_,17+6,_,7*6;
no digits, no strings: 68/2 = 34
<?=$p++,!$p++,$p+=$p,_,$p+=$p,_,~-$q=$p+$p,_,$q,_,--$p+$q,_,$p*~-$p;
Try them online.
PHP, 35/2=17.5
<?=zzzzzzzzzzzzzzz^NVBVKOVKLVHIVNH;
a digital approach: 40*.7=28
<?=2+2,_,5+3,_,17-2,_,17-1,_,17+6,_,7*6;
no digits, no strings: 68/2 = 34
<?=$p++,!$p++,$p+=$p,_,$p+=$p,_,~-$q=$p+$p,_,$q,_,--$p+$q,_,$p*~-$p;
Try them online.
answered 15 hours ago
Titus
12.7k11237
12.7k11237
1
Or just 14 bytes for<?=4815162342;
â Jo King
13 hours ago
1
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:4815162342
. Or<?=~
+ 10 unprintables -> 15/2=7.5
â Titus
7 hours ago
add a comment |Â
1
Or just 14 bytes for<?=4815162342;
â Jo King
13 hours ago
1
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:4815162342
. Or<?=~
+ 10 unprintables -> 15/2=7.5
â Titus
7 hours ago
1
1
Or just 14 bytes for
<?=4815162342;
â Jo King
13 hours ago
Or just 14 bytes for
<?=4815162342;
â Jo King
13 hours ago
1
1
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:
4815162342
. Or <?=~
+ 10 unprintables -> 15/2=7.5â Titus
7 hours ago
OP hasn´t replied to wether we can omit the delimiters or not; but yeah. Why not just 10 bytes:
4815162342
. Or <?=~
+ 10 unprintables -> 15/2=7.5â Titus
7 hours ago
add a comment |Â
up vote
1
down vote
Japt, 10 bytes / 2 = 5
"óT"mc w
Test it
add a comment |Â
up vote
1
down vote
Japt, 10 bytes / 2 = 5
"óT"mc w
Test it
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Japt, 10 bytes / 2 = 5
"óT"mc w
Test it
Japt, 10 bytes / 2 = 5
"óT"mc w
Test it
answered 11 hours ago
Shaggy
17.6k21663
17.6k21663
add a comment |Â
add a comment |Â
up vote
1
down vote
JavaScript (SpiderMonkey), 67 bytes / 2 = 33.5 60 bytes / 2 = 30 58 bytes / 2 = 29 48 bytes / 2 = 24
-7 bytes/3.5, -2 bytes/1 courtesy of @JoKing, -10 bytes/5 courtesy of @tsh
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
Try it online!
1
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
Or justprint(4815162342)
for 17 bytes
â Jo King
13 hours ago
add a comment |Â
up vote
1
down vote
JavaScript (SpiderMonkey), 67 bytes / 2 = 33.5 60 bytes / 2 = 30 58 bytes / 2 = 29 48 bytes / 2 = 24
-7 bytes/3.5, -2 bytes/1 courtesy of @JoKing, -10 bytes/5 courtesy of @tsh
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
Try it online!
1
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
Or justprint(4815162342)
for 17 bytes
â Jo King
13 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
JavaScript (SpiderMonkey), 67 bytes / 2 = 33.5 60 bytes / 2 = 30 58 bytes / 2 = 29 48 bytes / 2 = 24
-7 bytes/3.5, -2 bytes/1 courtesy of @JoKing, -10 bytes/5 courtesy of @tsh
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
Try it online!
JavaScript (SpiderMonkey), 67 bytes / 2 = 33.5 60 bytes / 2 = 30 58 bytes / 2 = 29 48 bytes / 2 = 24
-7 bytes/3.5, -2 bytes/1 courtesy of @JoKing, -10 bytes/5 courtesy of @tsh
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
Try it online!
edited 7 hours ago
answered 15 hours ago
guest271314
264211
264211
1
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
Or justprint(4815162342)
for 17 bytes
â Jo King
13 hours ago
add a comment |Â
1
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
Or justprint(4815162342)
for 17 bytes
â Jo King
13 hours ago
1
1
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
print(a=-~-~-~-~,a+=a,b=a+~-a,a+a,a+b,--b+b+b)
â tsh
14 hours ago
Or just
print(4815162342)
for 17 bytesâ Jo King
13 hours ago
Or just
print(4815162342)
for 17 bytesâ Jo King
13 hours ago
add a comment |Â
up vote
0
down vote
Python 2, 16 bytes
print 4815162342
Try it online!
add a comment |Â
up vote
0
down vote
Python 2, 16 bytes
print 4815162342
Try it online!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Python 2, 16 bytes
print 4815162342
Try it online!
Python 2, 16 bytes
print 4815162342
Try it online!
answered 16 hours ago
Vedant Kandoi
1166
1166
add a comment |Â
add a comment |Â
up vote
0
down vote
perl -M5.010 -Mre=eval, 32/2 == 16 bytes
This program is mostly unprintable characters -- characters which aren't even Unicode characters. Here is a hexdump of the program:
$ od -x solution
0000000 2727 7e3d 277e c0d7 8c84 869e cbd8 c7d3
0000020 ced3 d3ca c9ce cdd3 d3cc cdcb 82d8 27d6
0000040
$
And here's the program to create the solution:
#!/opt/perl/bin/perl
use 5.026;
use strict;
use warnings;
no warnings 'syntax';
use experimental 'signatures';
my $q = ~"(?say'4,8,15,16,23,42')";
print "''=~~'$q'";
__END__
add a comment |Â
up vote
0
down vote
perl -M5.010 -Mre=eval, 32/2 == 16 bytes
This program is mostly unprintable characters -- characters which aren't even Unicode characters. Here is a hexdump of the program:
$ od -x solution
0000000 2727 7e3d 277e c0d7 8c84 869e cbd8 c7d3
0000020 ced3 d3ca c9ce cdd3 d3cc cdcb 82d8 27d6
0000040
$
And here's the program to create the solution:
#!/opt/perl/bin/perl
use 5.026;
use strict;
use warnings;
no warnings 'syntax';
use experimental 'signatures';
my $q = ~"(?say'4,8,15,16,23,42')";
print "''=~~'$q'";
__END__
add a comment |Â
up vote
0
down vote
up vote
0
down vote
perl -M5.010 -Mre=eval, 32/2 == 16 bytes
This program is mostly unprintable characters -- characters which aren't even Unicode characters. Here is a hexdump of the program:
$ od -x solution
0000000 2727 7e3d 277e c0d7 8c84 869e cbd8 c7d3
0000020 ced3 d3ca c9ce cdd3 d3cc cdcb 82d8 27d6
0000040
$
And here's the program to create the solution:
#!/opt/perl/bin/perl
use 5.026;
use strict;
use warnings;
no warnings 'syntax';
use experimental 'signatures';
my $q = ~"(?say'4,8,15,16,23,42')";
print "''=~~'$q'";
__END__
perl -M5.010 -Mre=eval, 32/2 == 16 bytes
This program is mostly unprintable characters -- characters which aren't even Unicode characters. Here is a hexdump of the program:
$ od -x solution
0000000 2727 7e3d 277e c0d7 8c84 869e cbd8 c7d3
0000020 ced3 d3ca c9ce cdd3 d3cc cdcb 82d8 27d6
0000040
$
And here's the program to create the solution:
#!/opt/perl/bin/perl
use 5.026;
use strict;
use warnings;
no warnings 'syntax';
use experimental 'signatures';
my $q = ~"(?say'4,8,15,16,23,42')";
print "''=~~'$q'";
__END__
answered 8 hours ago
Abigail
39716
39716
add a comment |Â
add a comment |Â
up vote
0
down vote
Red, 50 bytes / 2 = 25
foreach c"abcdcefgaf"[prin index? find"cfgade.b"c]
Try it online!
Prints the numbers without separator
add a comment |Â
up vote
0
down vote
Red, 50 bytes / 2 = 25
foreach c"abcdcefgaf"[prin index? find"cfgade.b"c]
Try it online!
Prints the numbers without separator
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Red, 50 bytes / 2 = 25
foreach c"abcdcefgaf"[prin index? find"cfgade.b"c]
Try it online!
Prints the numbers without separator
Red, 50 bytes / 2 = 25
foreach c"abcdcefgaf"[prin index? find"cfgade.b"c]
Try it online!
Prints the numbers without separator
edited 8 hours ago
answered 8 hours ago
Galen Ivanov
5,46211031
5,46211031
add a comment |Â
add a comment |Â
up vote
0
down vote
APL(Dyalog Unicode), 18/2 = 9 bytes
ÃÂ/âÂÂUCS'𩦦湡'
Just boring old character multiplication.
Try it online!
The byte count is 18 in UTF-8. Neither𩦦
nor湡
exist in any APL code page, as far as I know.
â Dennisâ¦
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
add a comment |Â
up vote
0
down vote
APL(Dyalog Unicode), 18/2 = 9 bytes
ÃÂ/âÂÂUCS'𩦦湡'
Just boring old character multiplication.
Try it online!
The byte count is 18 in UTF-8. Neither𩦦
nor湡
exist in any APL code page, as far as I know.
â Dennisâ¦
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
APL(Dyalog Unicode), 18/2 = 9 bytes
ÃÂ/âÂÂUCS'𩦦湡'
Just boring old character multiplication.
Try it online!
APL(Dyalog Unicode), 18/2 = 9 bytes
ÃÂ/âÂÂUCS'𩦦湡'
Just boring old character multiplication.
Try it online!
edited 7 hours ago
answered 8 hours ago
Quintec
1,095517
1,095517
The byte count is 18 in UTF-8. Neither𩦦
nor湡
exist in any APL code page, as far as I know.
â Dennisâ¦
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
add a comment |Â
The byte count is 18 in UTF-8. Neither𩦦
nor湡
exist in any APL code page, as far as I know.
â Dennisâ¦
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
The byte count is 18 in UTF-8. Neither
𩦦
nor 湡
exist in any APL code page, as far as I know.â Dennisâ¦
7 hours ago
The byte count is 18 in UTF-8. Neither
𩦦
nor 湡
exist in any APL code page, as far as I know.â Dennisâ¦
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
@Dennis Thanks.
â Quintec
7 hours ago
add a comment |Â
up vote
0
down vote
Whitespace, score: 49 bytes / 2 = 24.5
[S S S T T S T T T S T T T T S S S T S N
_Push_56802][S S S T S T S S T S T T S S T S S S T T N
_Push_84771][T S S N
_Multiply][T N
S T _Print_as_integer]
Letters S
(space), T
(tab), and N
(new-line) added as highlighting only.[..._some_action]
added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Pseudo-code:
Integer i = 56802
Integer j = 84771
Integer k = i * j
Print k as number to STDOUT
add a comment |Â
up vote
0
down vote
Whitespace, score: 49 bytes / 2 = 24.5
[S S S T T S T T T S T T T T S S S T S N
_Push_56802][S S S T S T S S T S T T S S T S S S T T N
_Push_84771][T S S N
_Multiply][T N
S T _Print_as_integer]
Letters S
(space), T
(tab), and N
(new-line) added as highlighting only.[..._some_action]
added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Pseudo-code:
Integer i = 56802
Integer j = 84771
Integer k = i * j
Print k as number to STDOUT
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Whitespace, score: 49 bytes / 2 = 24.5
[S S S T T S T T T S T T T T S S S T S N
_Push_56802][S S S T S T S S T S T T S S T S S S T T N
_Push_84771][T S S N
_Multiply][T N
S T _Print_as_integer]
Letters S
(space), T
(tab), and N
(new-line) added as highlighting only.[..._some_action]
added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Pseudo-code:
Integer i = 56802
Integer j = 84771
Integer k = i * j
Print k as number to STDOUT
Whitespace, score: 49 bytes / 2 = 24.5
[S S S T T S T T T S T T T T S S S T S N
_Push_56802][S S S T S T S S T S T T S S T S S S T T N
_Push_84771][T S S N
_Multiply][T N
S T _Print_as_integer]
Letters S
(space), T
(tab), and N
(new-line) added as highlighting only.[..._some_action]
added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Pseudo-code:
Integer i = 56802
Integer j = 84771
Integer k = i * j
Print k as number to STDOUT
answered 6 hours ago
Kevin Cruijssen
32.9k554176
32.9k554176
add a comment |Â
add a comment |Â
up vote
0
down vote
Z80Golf, 17 bytes * 0.5 = 8.5
00000000: 1b17 1e1a 1e19 1d1c 1b1d 2676 0a03 c5ee ..........&v....
00000010: 2f /
Try it online!
Assembly:
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '8' ;17 rla
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '5' ;1a 0x1a
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '6' ;19 0x19
db 0x2F ^ '2' ;1d dec e
db 0x2F ^ '3' ;1c inc e
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '2' ;1d dec e
ld h, 0x76 ;halt
ld a, (bc) ;load the next digit. The first char in addr in 0x0
inc bc ;get next digit
push bc ;return to the next digit which is basically a nop
xor 0x2F ;decode the digit
;fall through into putchar. Putchar (0x8000), prints the char in register a
Assembly
add a comment |Â
up vote
0
down vote
Z80Golf, 17 bytes * 0.5 = 8.5
00000000: 1b17 1e1a 1e19 1d1c 1b1d 2676 0a03 c5ee ..........&v....
00000010: 2f /
Try it online!
Assembly:
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '8' ;17 rla
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '5' ;1a 0x1a
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '6' ;19 0x19
db 0x2F ^ '2' ;1d dec e
db 0x2F ^ '3' ;1c inc e
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '2' ;1d dec e
ld h, 0x76 ;halt
ld a, (bc) ;load the next digit. The first char in addr in 0x0
inc bc ;get next digit
push bc ;return to the next digit which is basically a nop
xor 0x2F ;decode the digit
;fall through into putchar. Putchar (0x8000), prints the char in register a
Assembly
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Z80Golf, 17 bytes * 0.5 = 8.5
00000000: 1b17 1e1a 1e19 1d1c 1b1d 2676 0a03 c5ee ..........&v....
00000010: 2f /
Try it online!
Assembly:
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '8' ;17 rla
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '5' ;1a 0x1a
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '6' ;19 0x19
db 0x2F ^ '2' ;1d dec e
db 0x2F ^ '3' ;1c inc e
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '2' ;1d dec e
ld h, 0x76 ;halt
ld a, (bc) ;load the next digit. The first char in addr in 0x0
inc bc ;get next digit
push bc ;return to the next digit which is basically a nop
xor 0x2F ;decode the digit
;fall through into putchar. Putchar (0x8000), prints the char in register a
Assembly
Z80Golf, 17 bytes * 0.5 = 8.5
00000000: 1b17 1e1a 1e19 1d1c 1b1d 2676 0a03 c5ee ..........&v....
00000010: 2f /
Try it online!
Assembly:
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '8' ;17 rla
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '5' ;1a 0x1a
db 0x2F ^ '1' ;1e ld e,
db 0x2F ^ '6' ;19 0x19
db 0x2F ^ '2' ;1d dec e
db 0x2F ^ '3' ;1c inc e
db 0x2F ^ '4' ;1b dec de
db 0x2F ^ '2' ;1d dec e
ld h, 0x76 ;halt
ld a, (bc) ;load the next digit. The first char in addr in 0x0
inc bc ;get next digit
push bc ;return to the next digit which is basically a nop
xor 0x2F ;decode the digit
;fall through into putchar. Putchar (0x8000), prints the char in register a
Assembly
edited 4 hours ago
answered 6 hours ago
Logern
59535
59535
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175277%2fprint-the-lost-numbers%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
I'm tagging the win condition as code challenge, since the score is a function of code length and whether the code omits certain characters.
â xnor
20 hours ago
1
If we use no separator, the numbers will be run together like
4815162342
. Is that OK?â xnor
20 hours ago
2
Related, closed question: codegolf.stackexchange.com/q/23808/67312
â Giuseppe
20 hours ago
2
Vaguely related: Are you lost yet?
â Dennisâ¦
20 hours ago
3
For future reference, we have a
restricted-source
tag that could have been used here: although most answers are avoiding obvious solutions, I think the challenge would have been slightly more interesting if using digits were forbidden altogether.â Arnauld
10 hours ago