String analayser
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Use any programming language to display "AWSALILAND" in such a way, so that each letter is in a new line and repeated as many times as its position in the English alphabet. For example letter, (A) should be displayed just once because it is the first letter of the alphabet. Letter D should be displayed 4 times because it is the 4th letter of the alphabet.
So, the output should be this:
A
WWWWWWWWWWWWWWWWWWWWWWW
SSSSSSSSSSSSSSSSSSS
A
LLLLLLLLLLLL
IIIIIIIII
LLLLLLLLLLLL
A
NNNNNNNNNNNNNN
DDDD
code-golf string kolmogorov-complexity
add a comment |Â
up vote
0
down vote
favorite
Use any programming language to display "AWSALILAND" in such a way, so that each letter is in a new line and repeated as many times as its position in the English alphabet. For example letter, (A) should be displayed just once because it is the first letter of the alphabet. Letter D should be displayed 4 times because it is the 4th letter of the alphabet.
So, the output should be this:
A
WWWWWWWWWWWWWWWWWWWWWWW
SSSSSSSSSSSSSSSSSSS
A
LLLLLLLLLLLL
IIIIIIIII
LLLLLLLLLLLL
A
NNNNNNNNNNNNNN
DDDD
code-golf string kolmogorov-complexity
4
Are lower-case letters OK?
– Emigna
32 mins ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Use any programming language to display "AWSALILAND" in such a way, so that each letter is in a new line and repeated as many times as its position in the English alphabet. For example letter, (A) should be displayed just once because it is the first letter of the alphabet. Letter D should be displayed 4 times because it is the 4th letter of the alphabet.
So, the output should be this:
A
WWWWWWWWWWWWWWWWWWWWWWW
SSSSSSSSSSSSSSSSSSS
A
LLLLLLLLLLLL
IIIIIIIII
LLLLLLLLLLLL
A
NNNNNNNNNNNNNN
DDDD
code-golf string kolmogorov-complexity
Use any programming language to display "AWSALILAND" in such a way, so that each letter is in a new line and repeated as many times as its position in the English alphabet. For example letter, (A) should be displayed just once because it is the first letter of the alphabet. Letter D should be displayed 4 times because it is the 4th letter of the alphabet.
So, the output should be this:
A
WWWWWWWWWWWWWWWWWWWWWWW
SSSSSSSSSSSSSSSSSSS
A
LLLLLLLLLLLL
IIIIIIIII
LLLLLLLLLLLL
A
NNNNNNNNNNNNNN
DDDD
code-golf string kolmogorov-complexity
code-golf string kolmogorov-complexity
edited 5 mins ago


Kevin Cruijssen
31.9k553172
31.9k553172
asked 55 mins ago
Monolica
244111
244111
4
Are lower-case letters OK?
– Emigna
32 mins ago
add a comment |Â
4
Are lower-case letters OK?
– Emigna
32 mins ago
4
4
Are lower-case letters OK?
– Emigna
32 mins ago
Are lower-case letters OK?
– Emigna
32 mins ago
add a comment |Â
9 Answers
9
active
oldest
votes
up vote
2
down vote
05AB1E, 17 bytes
.•DθîRI§•ʒAyk>×u,
Try it online!
Explanation
.•DθîRI§• # push compressed string "awsaliland"
ʒ # filter
Ayk # get the index of the current letter in the alphabet
> # increment
× # repeat it that many times
u # upper-case
, # print
We only use filter here to save a byte over other loops due to ac implicit copy of the element on the stack. Filter works here since we print in the loop and don't care about the result of the filter.
add a comment |Â
up vote
2
down vote
C# (Visual C# Interactive Compiler), 61 bytes
foreach(var s in"AWSALILAND")WriteLine(new string(s,s-64));
Try it online!
add a comment |Â
up vote
1
down vote
Japt -R
, 16 bytes
`awѢӀ`¨pZc uH
`awÑ¢Ó€`¬®pZc uH Full program
`awѢӀ` Compressed "awasiland"
¨ split and map
p repeat each word times:
Zc get charcode
uH Modulo 32
Try it online!
add a comment |Â
up vote
0
down vote
Python 3,41 bytes
for i in'AWSALILAND':print(i*(ord(i)-64))
Python 2,40 bytes
for i in'AWSALILAND':print i*(ord(i)-64)
add a comment |Â
up vote
0
down vote
Pyth, 20 bytes
jm*d-Cd64"AWSALILAND
Try it online here.
jm*d-Cd64"AWSALILAND
"AWSALILAND String literal "AWSALILAND"
m Map each character of the above, as d, using:
Cd Get character code of d
- 64 Subtract 64
*d Repeat d that many times
j Join on newlines, implicit print
19 byte alternative, which outputs lower case: jm*dhxGd"awsaliland
- link
add a comment |Â
up vote
0
down vote
J, 31 bytes
echo(#&>~_64+a.i.])'AWSALILAND'
Try it online!
Explanation:
echo(#&>~_64+a.i.])'AWSALILAND' - print
# ~ - copy (arguments reversed)
&> - each character (can be "0)
i. - the index of
] - the characters in
a. - the alphabet
_64+ - minus 64 (times)
add a comment |Â
up vote
0
down vote
Scala (51 bytes):
"AWSALILAND"map(c=>s"$c"*(c-64)mkString)map println
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
add a comment |Â
up vote
0
down vote
APL (Dyalog Classic), 24 bytes
⎕â†Â↑aâ´¨â¨⎕Aâ³aâ†Â'AWSALILAND'
Try it online!
add a comment |Â
up vote
0
down vote
Python 3, 39 bytes
for c in"AWSALILAND":print(ord(c)%32*c)
Try it online!
add a comment |Â
9 Answers
9
active
oldest
votes
9 Answers
9
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
05AB1E, 17 bytes
.•DθîRI§•ʒAyk>×u,
Try it online!
Explanation
.•DθîRI§• # push compressed string "awsaliland"
ʒ # filter
Ayk # get the index of the current letter in the alphabet
> # increment
× # repeat it that many times
u # upper-case
, # print
We only use filter here to save a byte over other loops due to ac implicit copy of the element on the stack. Filter works here since we print in the loop and don't care about the result of the filter.
add a comment |Â
up vote
2
down vote
05AB1E, 17 bytes
.•DθîRI§•ʒAyk>×u,
Try it online!
Explanation
.•DθîRI§• # push compressed string "awsaliland"
ʒ # filter
Ayk # get the index of the current letter in the alphabet
> # increment
× # repeat it that many times
u # upper-case
, # print
We only use filter here to save a byte over other loops due to ac implicit copy of the element on the stack. Filter works here since we print in the loop and don't care about the result of the filter.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
05AB1E, 17 bytes
.•DθîRI§•ʒAyk>×u,
Try it online!
Explanation
.•DθîRI§• # push compressed string "awsaliland"
ʒ # filter
Ayk # get the index of the current letter in the alphabet
> # increment
× # repeat it that many times
u # upper-case
, # print
We only use filter here to save a byte over other loops due to ac implicit copy of the element on the stack. Filter works here since we print in the loop and don't care about the result of the filter.
05AB1E, 17 bytes
.•DθîRI§•ʒAyk>×u,
Try it online!
Explanation
.•DθîRI§• # push compressed string "awsaliland"
ʒ # filter
Ayk # get the index of the current letter in the alphabet
> # increment
× # repeat it that many times
u # upper-case
, # print
We only use filter here to save a byte over other loops due to ac implicit copy of the element on the stack. Filter works here since we print in the loop and don't care about the result of the filter.
answered 24 mins ago


Emigna
43.8k431133
43.8k431133
add a comment |Â
add a comment |Â
up vote
2
down vote
C# (Visual C# Interactive Compiler), 61 bytes
foreach(var s in"AWSALILAND")WriteLine(new string(s,s-64));
Try it online!
add a comment |Â
up vote
2
down vote
C# (Visual C# Interactive Compiler), 61 bytes
foreach(var s in"AWSALILAND")WriteLine(new string(s,s-64));
Try it online!
add a comment |Â
up vote
2
down vote
up vote
2
down vote
C# (Visual C# Interactive Compiler), 61 bytes
foreach(var s in"AWSALILAND")WriteLine(new string(s,s-64));
Try it online!
C# (Visual C# Interactive Compiler), 61 bytes
foreach(var s in"AWSALILAND")WriteLine(new string(s,s-64));
Try it online!
answered 14 mins ago


pocki_c
512
512
add a comment |Â
add a comment |Â
up vote
1
down vote
Japt -R
, 16 bytes
`awѢӀ`¨pZc uH
`awÑ¢Ó€`¬®pZc uH Full program
`awѢӀ` Compressed "awasiland"
¨ split and map
p repeat each word times:
Zc get charcode
uH Modulo 32
Try it online!
add a comment |Â
up vote
1
down vote
Japt -R
, 16 bytes
`awѢӀ`¨pZc uH
`awÑ¢Ó€`¬®pZc uH Full program
`awѢӀ` Compressed "awasiland"
¨ split and map
p repeat each word times:
Zc get charcode
uH Modulo 32
Try it online!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Japt -R
, 16 bytes
`awѢӀ`¨pZc uH
`awÑ¢Ó€`¬®pZc uH Full program
`awѢӀ` Compressed "awasiland"
¨ split and map
p repeat each word times:
Zc get charcode
uH Modulo 32
Try it online!
Japt -R
, 16 bytes
`awѢӀ`¨pZc uH
`awÑ¢Ó€`¬®pZc uH Full program
`awѢӀ` Compressed "awasiland"
¨ split and map
p repeat each word times:
Zc get charcode
uH Modulo 32
Try it online!
edited 34 mins ago
answered 44 mins ago


Luis felipe De jesus Munoz
3,29111049
3,29111049
add a comment |Â
add a comment |Â
up vote
0
down vote
Python 3,41 bytes
for i in'AWSALILAND':print(i*(ord(i)-64))
Python 2,40 bytes
for i in'AWSALILAND':print i*(ord(i)-64)
add a comment |Â
up vote
0
down vote
Python 3,41 bytes
for i in'AWSALILAND':print(i*(ord(i)-64))
Python 2,40 bytes
for i in'AWSALILAND':print i*(ord(i)-64)
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Python 3,41 bytes
for i in'AWSALILAND':print(i*(ord(i)-64))
Python 2,40 bytes
for i in'AWSALILAND':print i*(ord(i)-64)
Python 3,41 bytes
for i in'AWSALILAND':print(i*(ord(i)-64))
Python 2,40 bytes
for i in'AWSALILAND':print i*(ord(i)-64)
answered 32 mins ago
Vedant Kandoi
415
415
add a comment |Â
add a comment |Â
up vote
0
down vote
Pyth, 20 bytes
jm*d-Cd64"AWSALILAND
Try it online here.
jm*d-Cd64"AWSALILAND
"AWSALILAND String literal "AWSALILAND"
m Map each character of the above, as d, using:
Cd Get character code of d
- 64 Subtract 64
*d Repeat d that many times
j Join on newlines, implicit print
19 byte alternative, which outputs lower case: jm*dhxGd"awsaliland
- link
add a comment |Â
up vote
0
down vote
Pyth, 20 bytes
jm*d-Cd64"AWSALILAND
Try it online here.
jm*d-Cd64"AWSALILAND
"AWSALILAND String literal "AWSALILAND"
m Map each character of the above, as d, using:
Cd Get character code of d
- 64 Subtract 64
*d Repeat d that many times
j Join on newlines, implicit print
19 byte alternative, which outputs lower case: jm*dhxGd"awsaliland
- link
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Pyth, 20 bytes
jm*d-Cd64"AWSALILAND
Try it online here.
jm*d-Cd64"AWSALILAND
"AWSALILAND String literal "AWSALILAND"
m Map each character of the above, as d, using:
Cd Get character code of d
- 64 Subtract 64
*d Repeat d that many times
j Join on newlines, implicit print
19 byte alternative, which outputs lower case: jm*dhxGd"awsaliland
- link
Pyth, 20 bytes
jm*d-Cd64"AWSALILAND
Try it online here.
jm*d-Cd64"AWSALILAND
"AWSALILAND String literal "AWSALILAND"
m Map each character of the above, as d, using:
Cd Get character code of d
- 64 Subtract 64
*d Repeat d that many times
j Join on newlines, implicit print
19 byte alternative, which outputs lower case: jm*dhxGd"awsaliland
- link
answered 29 mins ago


Sok
3,111722
3,111722
add a comment |Â
add a comment |Â
up vote
0
down vote
J, 31 bytes
echo(#&>~_64+a.i.])'AWSALILAND'
Try it online!
Explanation:
echo(#&>~_64+a.i.])'AWSALILAND' - print
# ~ - copy (arguments reversed)
&> - each character (can be "0)
i. - the index of
] - the characters in
a. - the alphabet
_64+ - minus 64 (times)
add a comment |Â
up vote
0
down vote
J, 31 bytes
echo(#&>~_64+a.i.])'AWSALILAND'
Try it online!
Explanation:
echo(#&>~_64+a.i.])'AWSALILAND' - print
# ~ - copy (arguments reversed)
&> - each character (can be "0)
i. - the index of
] - the characters in
a. - the alphabet
_64+ - minus 64 (times)
add a comment |Â
up vote
0
down vote
up vote
0
down vote
J, 31 bytes
echo(#&>~_64+a.i.])'AWSALILAND'
Try it online!
Explanation:
echo(#&>~_64+a.i.])'AWSALILAND' - print
# ~ - copy (arguments reversed)
&> - each character (can be "0)
i. - the index of
] - the characters in
a. - the alphabet
_64+ - minus 64 (times)
J, 31 bytes
echo(#&>~_64+a.i.])'AWSALILAND'
Try it online!
Explanation:
echo(#&>~_64+a.i.])'AWSALILAND' - print
# ~ - copy (arguments reversed)
&> - each character (can be "0)
i. - the index of
] - the characters in
a. - the alphabet
_64+ - minus 64 (times)
answered 14 mins ago
Galen Ivanov
5,2521931
5,2521931
add a comment |Â
add a comment |Â
up vote
0
down vote
Scala (51 bytes):
"AWSALILAND"map(c=>s"$c"*(c-64)mkString)map println
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
add a comment |Â
up vote
0
down vote
Scala (51 bytes):
"AWSALILAND"map(c=>s"$c"*(c-64)mkString)map println
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Scala (51 bytes):
"AWSALILAND"map(c=>s"$c"*(c-64)mkString)map println
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Scala (51 bytes):
"AWSALILAND"map(c=>s"$c"*(c-64)mkString)map println
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 7 mins ago
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 35 mins ago


jrook
1012
1012
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
jrook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
add a comment |Â
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
This is a code golf question. So you should include your score.
– Post Left Ghost Hunter
9 mins ago
add a comment |Â
up vote
0
down vote
APL (Dyalog Classic), 24 bytes
⎕â†Â↑aâ´¨â¨⎕Aâ³aâ†Â'AWSALILAND'
Try it online!
add a comment |Â
up vote
0
down vote
APL (Dyalog Classic), 24 bytes
⎕â†Â↑aâ´¨â¨⎕Aâ³aâ†Â'AWSALILAND'
Try it online!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
APL (Dyalog Classic), 24 bytes
⎕â†Â↑aâ´¨â¨⎕Aâ³aâ†Â'AWSALILAND'
Try it online!
APL (Dyalog Classic), 24 bytes
⎕â†Â↑aâ´¨â¨⎕Aâ³aâ†Â'AWSALILAND'
Try it online!
answered 3 mins ago
Galen Ivanov
5,2521931
5,2521931
add a comment |Â
add a comment |Â
up vote
0
down vote
Python 3, 39 bytes
for c in"AWSALILAND":print(ord(c)%32*c)
Try it online!
add a comment |Â
up vote
0
down vote
Python 3, 39 bytes
for c in"AWSALILAND":print(ord(c)%32*c)
Try it online!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Python 3, 39 bytes
for c in"AWSALILAND":print(ord(c)%32*c)
Try it online!
Python 3, 39 bytes
for c in"AWSALILAND":print(ord(c)%32*c)
Try it online!
answered 1 min ago
tsh
7,63611344
7,63611344
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%2f174180%2fstring-analayser%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
4
Are lower-case letters OK?
– Emigna
32 mins ago