| Bytes | Lang | Time | Link |
|---|---|---|---|
| 289 | Bespoke | 250818T054930Z | Josiah W |
| 020 | Uiua | 240810T045330Z | ErikDaPa |
| 089 | AWK | 241202T205818Z | xrs |
| 075 | Tcl | 181227T170806Z | sergiol |
| 015 | 05AB1E | 241203T092402Z | Kevin Cr |
| 068 | JavaScript Node.js | 240809T001656Z | Andrew B |
| 016 | Vyxal j | 221013T045641Z | DialFros |
| 162 | CSASM v2.2.1.2 | 210322T090058Z | absolute |
| 284 | Deadfish~ | 210322T082053Z | emanresu |
| 019 | Husk | 201016T191021Z | LegionMa |
| 470 | Poetic | 191118T125246Z | JosiahRy |
| 056 | Retina | 190505T203458Z | lolad |
| 083 | C++ gcc | 181017T185355Z | G. Sliep |
| 068 | JavaScript | 190505T014451Z | Naruyoko |
| 034 | Ahead | 190504T064318Z | snail_ |
| 192 | Deadfish~ | 190416T192941Z | squid |
| 040 | 8088 machine code | 190416T151539Z | 640KB |
| 040 | ><> | 190416T071922Z | Emigna |
| 070 | VBA Excel | 190416T064757Z | remoel |
| 037 | Perl 6 | 190415T192147Z | bb94 |
| 034 | PowerShell | 181017T135444Z | AdmBorkB |
| 4349 | Turing Machine But Way Worse | 181227T034832Z | MilkyWay |
| 082 | /// | 181101T035025Z | Conor O& |
| 093 | PHP | 181017T163905Z | Francisc |
| 162 | Java JDK | 181018T173458Z | Syed Ham |
| 044 | APLNARS | 181019T080034Z | user5898 |
| 051 | Scala | 181017T120241Z | jrook |
| 030 | Z80Golf | 181017T141339Z | user3604 |
| 095 | Swift | 181018T184304Z | Nathan A |
| 081 | Java 11 | 181017T124403Z | Kevin Cr |
| 041 | Julia | 181018T155149Z | EricSher |
| 063 | JavaScript Node.js | 181017T143359Z | Zenoo |
| 059 | C# Visual C# Interactive Compiler | 181017T122331Z | pocki_c |
| 039 | Ruby | 181018T100308Z | G B |
| 066 | F# .NET Core | 181018T084044Z | aloisdg |
| 073 | C clang | 181018T022019Z | user3604 |
| 112 | brainfuck | 181018T015935Z | Jo King |
| 029 | Bubblegum | 181018T012234Z | LegionMa |
| 038 | Python 2 | 181018T010411Z | Chas Bro |
| 058 | PHP | 181018T005640Z | Titus |
| 057 | QBasic | 181017T212328Z | DLosc |
| 021 | Pip l | 181017T204914Z | DLosc |
| 100 | Go | 181017T202438Z | J. Sall& |
| 083 | TSQL | 181017T191707Z | BradC |
| 017 | Jelly | 181017T184750Z | Jonathan |
| 096 | Common Lisp | 181017T184037Z | JRowan |
| 016 | SOGL V0.12 | 181017T181915Z | dzaima |
| 071 | PHP | 181017T175326Z | Mic1780 |
| 022 | K ngn/k | 181017T160547Z | Thaufeki |
| 043 | Haskell | 181017T173335Z | nimi |
| 017 | Japt | 181017T115342Z | Luis fel |
| 061 | R | 181017T162756Z | J.Doe |
| 083 | Dart | 181017T164542Z | Elcan |
| 017 | Charcoal | 181017T161917Z | Neil |
| 086 | MBASIC | 181017T153844Z | wooshiny |
| 020 | Jelly | 181017T153731Z | Erik the |
| 035 | Perl 5 | 181017T134800Z | nwellnho |
| 059 | Red | 181017T131904Z | Galen Iv |
| 015 | Stax | 181017T130423Z | Multi |
| 022 | APL Dyalog Classic | 181017T123458Z | Galen Iv |
| 020 | MATL | 181017T124921Z | Luis Men |
| 088 | SNOBOL4 CSNOBOL4 | 181017T124203Z | Giuseppe |
| 031 | J | 181017T122349Z | Galen Iv |
| 017 | 05AB1E | 181017T121404Z | Emigna |
| 020 | Pyth | 181017T120818Z | Sok |
| 041 | Python 3 | 181017T120603Z | Vedant K |
Bespoke, 356 289 bytes
-67 bytes by pushing the letter indices directly, instead of decoding them from a base-24 number.
show"AWSA-LIL-AN-D"with each A out to D in that repeating
and an A is just A;but an I=IIIIIIIII,and it is for nine I letters
indices of them specify repeats when it is shown
use of letter math converts from number to alphabet spelling
it will display and use an A,continuing nicely up to D
My first attempt at writing this used an over-complicated approach with a large number I convert to base 24. That was a bit silly of me.
Uiua, 20 bytes
⍚(↯-@@.)"AWSALILAND"
Explanation:
⍚(↯-@@.)"AWSALILAND"
"AWSALILAND" => the string
-@@. => find index in alphabet
↯ => duplicate letter by index
⍚( ) => unbox each item and then box the results (since they each have different dimensions)
AWK, 95 89 bytes
@load"ordchr";{for(;i++<split("AWSALILAND",a,X);print)for(j=ord(x=a[i])-64;j--;)printf x}
@load"ordchr"; # to convert char to int
{for(;i++<split("AWSALILAND",a,X); # split returns array length
print) # new line
for(j=ord( # ord returns int from char
x=a[i]) # grab value from array
-64; # adjust for offset
j--;) # till zero
printf x} # print single char
95 bytes
@load "ordchr"
END{for(;i++<split("AWSALILAND",a,X);print)for(j=0;j++<ord(g=a[i])-64;)printf g}
Tcl, 75 bytes
lmap x [split AWSALILAND ""] {puts [string repe $x [expr [scan $x %c]-64]]}
05AB1E, 15 bytes
•9¢y` т•₂вD.b×»
Explanation:
The .b builtin is perfect for this challenge, since it uses the 1-based uppercase alphabet letter, so no need for additional to-uppercase or changing the index from 0-based to 1-based.
•9¢y` т• # Push compressed integer 10385586374596
₂в # Convert it to base 26 as list: [1,23,19,1,12,9,12,1,14,4]
D # Duplicate this list
.b # Map each integer to its uppercase alphabet letter
× # Repeat each letter the value at the same position amount of times
» # Join the list by newlines
See this 05AB1E tip (sections How to compress large integers? and How to compress integer lists?) to understand why •9¢y` т• is 10385586374596 and •9¢y` т•₂в is [1,23,19,1,12,9,12,1,14,4].
JavaScript (Node.js), 68 bytes
_=>`AWSALILAND`.replace(/./g,c=>''.padEnd(c.charCodeAt(0)-64,c)+`
`)
Vyxal j, 18 16 bytes
`AWSALILAND`ƛøA*
Explained
`AWSALILAND`ƛøA*
ƛ # mapping lambda
øA # string to number in alphabet
* # times the character
j flag to print with newlines
CSASM v2.2.1.2, 162 bytes
func main:
lda 0
sta $1
lda "AWSALILAND"
.lbl a
push $a
conv ~arr:char
ldelem $1
dup
conv i32
push 64
sub
pop $2
conv str
push $2
mul
print.n
inc $1
push $1
push 10
sub
brtrue a
ret
end
Commented and ungolfed:
func main:
; Initialize $1 to zero and $a to the string "AWSALILAND"
lda 0
sta $1
lda "AWSALILAND"
.lbl loop
; Get the iteration char in the string
push $a
conv ~arr:char
ldelem $1
; Duplicate it. The first will be used as the string to print and the
; second will be used for the string repetitions with "mul"
dup
; Get the index in the alphabet (1..26) and put it in $2
conv i32
push 64
sub
pop $2
; Convert the character to a string, then perform the built-in string
; repetitions with "mul"
conv str
push $2
mul
; Print it with a newline appended
print.n
; Truthy is non-zero, so the loop ends when ($1 + 1) - 10 == 0
inc $1
push $1
push 10
sub
brtrue loop
ret
end
Deadfish~, 284 bytes
{iiiiii}iiiiic{ddddd}dddddc{{i}dd}ddd{cc}ccc{{d}ii}iiic{{i}ddd}iii{c}ccccccccc{{d}iii}dddc{iiiii}iiiiic{ddddd}dddddc{iiiiii}iiiiii{c}cc{dddddd}ddddddc{iiiiii}iiiccccccccc{dddddd}dddc{iiiiii}iiiiii{c}cc{dddddd}ddddddc{iiiii}iiiiic{ddddd}dddddc{{i}ddd}dd{c}cccc{{d}iii}iic{iiiiii}ddcccc
Poetic, 470 bytes
any days i wish i could&i say i could,i can not
still at the age where,a lot of times,i can not raise my own money
guess i got myself overly exhausted,or spent
no pun is meant
i was a child of ten,a child of ten
a thing i know:i saved a buck a month
m-one-y,m-one-y,m-ones-y
still,i had a dream,i had a vision
oh my god,what a dream
i had a vision i was rich
at first im like:o,i have a payoff,o
however,truly i am not especially pleased
indeed,o,i see i am scared of it
I don't especially like the fact that I have to hardcode AWSALILAND (mostly because I don't know what that means). But at least this works.
Retina, 56 bytes
K`AWSALILAND
L`.
W
23*W
S
19*S
L
22*L
I
9*I
D
4*D
N
14*N
Explanation:
K`AWSALIAND
Sets the working string to AWSALIAND
L`.
Puts each character onto a new line. L is a list, and each item is found by the regex /./.
character
n*character
Replace all occurences of character with n lots of the character.
C++ (gcc), 90 83 bytes
#include<map>
int main(){for(auto c:"AWSALILAND")c&&puts(&std::string(c-64,c)[0]);}
Thanks to movatica for shaving off 7 bytes!
JavaScript, 74 68 bytes
for(i in s="AWSALILAND")console.log(s[i].repeat(s.charCodeAt(i)-64))
- 74->68, -6B for changing
forloop tofor...in, saving bytes on loop statement, removed increment, and removing statement to save the character.
Deadfish~, 192 bytes
{i}ddsic{{d}}{i}cs{d}dddccc{cc}{{d}}{i}cdsii{c}ccccccccc{{d}}{i}cddsic{{d}}{i}cdsddddd{c}cc{{d}}{i}cdds{i}dccccccccc{{d}}{i}cdsddddd{c}cc{{d}}{i}cddsic{{d}}{i}cdsddd{c}cccc{{d}}{i}cddsiiiicccc
Frankly, I'm just stoked it's below 200 bytes.
8088 machine code, IBM PC DOS, 40 bytes
Listing:
B4 02 MOV AH, 2 ; DOS API display char function
B1 0A MOV CL, 10 ; CL length of string
BE 011E MOV SI, OFFSET S ; point SI to AWSALILAND string
LOOP_CHAR:
AC LODSB ; load next byte into AL
8A D0 MOV DL, AL ; put in DL for display
2C 40 SUB AL, 'A'-1 ; convert ASCII char to 1-based counter
8A D8 MOV BL, AL ; move to BL for repeat loop
LOOP_REP:
CD 21 INT 21H ; display char in DL
4B DEC BX ; decrement repeat counter
75 FB JNZ LOOP_REP ; repeat char loop
B2 0D MOV DL, 0DH ; display CR
CD 21 INT 21H
B2 0A MOV DL, 0AH ; display LF
CD 21 INT 21H
E2 EA LOOP LOOP_CHAR ; next char loop
C3 RET ; return to DOS
S DB 'AWSALILAND' ; define static string in memory
Actually turned out to be longer than I thought. Of course, it doesn't help that it costs 8 bytes to display a newline using the DOS console API.
Output
Download and test AWA.COM.
VBA (Excel), 70 bytes
using Immediate window
a="AWSALILAND":For x=1To Len(a):b=Mid(a,x,1):?String(Asc(b)-64,b):Next
PowerShell, 34 bytes
"AWSALILAND"|% t*y|%{"$_"*($_-64)}
Takes the string toCharArray, then multiplies each letter out the corresponding number of times. Implicit Write-Output gives us newlines for free.
Ho-hum.
Turing Machine But Way Worse - 4349 bytes
0 0 0 1 1 0 0
0 1 1 1 2 0 0
0 2 0 1 3 0 0
0 3 0 1 4 0 0
0 4 0 1 5 0 0
0 5 0 1 6 0 0
0 6 0 1 7 0 0
0 7 1 0 8 1 0
0 8 1 1 0 0 0
1 0 0 0 1 0 0
1 1 1 0 9 0 0
0 9 0 0 10 0 0
0 10 1 0 11 0 0
0 11 0 0 12 0 0
0 12 0 0 2 0 0
1 2 0 0 13 1 0
0 13 0 1 14 0 0
0 14 1 0 15 0 0
0 15 0 1 3 0 0
1 3 1 1 16 0 0
0 16 0 1 17 0 0
0 17 1 0 18 0 0
0 18 0 1 4 0 0
1 4 1 1 5 0 0
1 5 0 0 6 0 0
1 6 1 1 19 0 0
0 19 0 1 20 0 0
0 20 1 1 7 0 0
1 7 1 1 21 0 0
0 21 1 0 8 1 0
1 8 1 0 9 1 0
1 9 1 0 22 1 0
0 22 0 0 10 1 0
1 10 1 1 23 1 0
0 23 0 0 11 1 0
1 11 1 1 24 1 0
0 24 0 0 12 1 0
1 12 1 1 25 1 0
0 25 0 0 13 1 0
1 13 1 1 26 1 0
0 26 0 0 14 1 0
1 14 1 1 27 1 0
0 27 0 0 15 1 0
1 15 1 1 28 1 0
0 28 0 0 16 1 0
1 16 1 1 29 1 0
0 29 0 0 17 1 0
1 17 1 1 30 1 0
0 30 0 0 18 1 0
1 18 1 1 31 1 0
0 31 0 0 19 1 0
1 19 1 1 32 1 0
0 32 1 1 20 0 0
1 20 0 1 21 0 0
1 21 1 1 22 0 0
1 22 0 0 23 0 0
1 23 1 0 33 0 0
0 33 0 0 24 0 0
1 24 1 0 25 0 0
1 25 0 0 34 0 0
0 34 0 0 26 0 0
1 26 0 0 35 1 0
0 35 0 1 36 0 0
0 36 1 0 37 0 0
0 37 0 1 27 0 0
1 27 1 1 38 0 0
0 38 0 1 39 0 0
0 39 1 0 40 0 0
0 40 0 1 28 0 0
1 28 1 1 29 0 0
1 29 0 1 41 0 0
0 41 0 1 30 0 0
1 30 1 1 42 0 0
0 42 1 0 31 1 0
1 31 1 0 43 1 0
0 43 0 0 44 1 0
0 44 0 0 32 1 0
1 32 1 1 45 1 0
0 45 0 0 33 1 0
1 33 1 1 46 1 0
0 46 0 0 34 1 0
1 34 1 1 47 1 0
0 47 0 0 35 1 0
1 35 1 1 48 1 0
0 48 0 0 36 1 0
1 36 1 1 49 1 0
0 49 0 0 37 1 0
1 37 1 1 50 1 0
0 50 0 0 38 1 0
1 38 1 1 51 1 0
0 51 0 0 39 1 0
1 39 1 1 52 1 0
0 52 1 1 53 0 0
0 53 0 1 40 0 0
1 40 1 1 41 0 0
1 41 0 0 42 0 0
1 42 1 0 54 0 0
0 54 0 0 43 0 0
1 43 1 0 44 0 0
1 44 0 0 55 0 0
0 55 0 0 45 0 0
1 45 0 0 56 1 0
0 56 0 1 57 0 0
0 57 1 0 58 0 0
0 58 0 1 46 0 0
1 46 1 1 59 0 0
0 59 0 1 60 0 0
0 60 0 1 47 0 0
1 47 0 0 61 0 0
0 61 0 1 62 0 0
0 62 0 1 63 0 0
0 63 0 1 48 0 0
1 48 0 1 64 0 0
0 64 1 0 65 1 0
0 65 1 1 49 0 0
1 49 0 0 50 0 0
1 50 1 0 66 0 0
0 66 0 0 67 0 0
0 67 1 0 68 0 0
0 68 0 0 69 0 0
0 69 0 0 51 0 0
1 51 0 0 70 1 0
0 70 0 1 71 0 0
0 71 1 0 72 0 0
0 72 0 1 52 0 0
1 52 1 1 73 0 0
0 73 0 1 74 0 0
0 74 0 1 53 0 0
1 53 1 1 75 0 0
0 75 1 1 54 0 0
1 54 0 0 55 1 0
1 55 1 0 56 1 0
1 56 1 0 76 1 0
0 76 0 1 57 1 0
1 57 1 0 77 1 0
0 77 0 1 58 1 0
1 58 1 0 78 1 0
0 78 0 1 59 1 0
1 59 1 0 79 1 0
0 79 0 1 60 1 0
1 60 1 0 80 1 0
0 80 0 1 61 1 0
1 61 1 1 62 0 0
1 62 0 1 81 0 0
0 81 1 0 82 0 0
0 82 0 0 63 0 0
1 63 1 0 83 0 0
0 83 0 0 84 0 0
0 84 0 0 64 0 0
1 64 0 0 85 1 0
0 85 0 1 86 0 0
0 86 1 0 87 0 0
0 87 0 1 65 0 0
1 65 1 1 88 0 0
0 88 0 1 89 0 0
0 89 0 1 66 0 0
1 66 1 1 90 0 0
0 90 0 1 67 0 0
1 67 0 1 91 0 0
0 91 1 0 92 1 0
0 92 0 0 93 1 0
0 93 0 0 68 1 0
1 68 1 0 94 1 0
0 94 0 1 69 1 0
1 69 1 0 95 1 0
0 95 0 1 70 1 0
1 70 1 0 96 1 0
0 96 0 1 71 1 0
1 71 1 1 97 0 0
0 97 0 1 98 0 0
0 98 1 1 72 0 0
1 72 0 0 73 0 0
1 73 1 0 99 0 0
0 99 0 0 74 0 0
1 74 1 0 100 0 0
0 100 0 0 101 0 0
0 101 0 0 75 0 0
1 75 0 0 102 1 0
0 102 0 1 103 0 0
0 103 1 0 104 0 0
0 104 0 1 76 0 0
1 76 1 1 105 0 0
0 105 0 1 106 0 0
0 106 0 1 77 0 0
1 77 1 1 107 0 0
0 107 1 1 78 0 0
1 78 0 0 79 1 0
1 79 1 0 80 1 0
1 80 1 0 108 1 0
0 108 0 1 81 1 0
1 81 1 0 109 1 0
0 109 0 1 82 1 0
1 82 1 0 110 1 0
0 110 0 1 83 1 0
1 83 1 0 111 1 0
0 111 0 1 84 1 0
1 84 1 0 112 1 0
0 112 0 1 85 1 0
1 85 1 1 86 0 0
1 86 0 1 113 0 0
0 113 1 0 114 0 0
0 114 0 0 87 0 0
1 87 1 0 115 0 0
0 115 0 0 116 0 0
0 116 0 0 88 0 0
1 88 0 0 117 1 0
0 117 0 1 118 0 0
0 118 1 0 119 0 0
0 119 0 1 89 0 0
1 89 1 1 120 0 0
0 120 0 1 121 0 0
0 121 0 1 90 0 0
1 90 0 0 122 0 0
0 122 0 1 123 0 0
0 123 0 1 124 0 0
0 124 0 1 91 0 0
1 91 0 1 125 0 0
0 125 1 0 126 1 0
0 126 1 1 92 0 0
1 92 0 0 93 0 0
1 93 1 0 127 0 0
0 127 0 0 128 0 0
0 128 1 0 129 0 0
0 129 0 0 130 0 0
0 130 0 0 94 0 0
1 94 0 0 131 1 0
0 131 0 1 132 0 0
0 132 1 1 133 0 0
0 133 0 1 134 0 0
0 134 0 1 95 0 0
1 95 1 1 135 0 0
0 135 1 0 96 1 0
1 96 1 0 136 1 0
0 136 0 1 97 1 0
1 97 1 0 137 1 0
0 137 0 1 98 1 0
1 98 1 0 138 1 0
0 138 0 1 99 1 0
1 99 1 0 139 1 0
0 139 0 1 100 1 0
1 100 1 0 140 1 0
0 140 0 1 101 1 0
1 101 1 0 141 1 0
0 141 0 1 102 1 0
1 102 1 0 142 1 0
0 142 0 1 103 0 0
1 103 1 1 104 0 0
1 104 0 0 105 0 0
1 105 1 0 143 0 0
0 143 0 0 144 0 0
0 144 0 0 106 0 0
1 106 0 0 145 1 0
0 145 0 1 146 0 0
0 146 1 0 147 0 0
0 147 0 1 107 0 0
1 107 1 1 148 0 0
0 148 0 1 149 0 0
0 149 0 1 108 0 0
1 108 0 0 150 0 0
0 150 0 1 151 0 0
0 151 0 1 152 0 0
0 152 1 1 109 0 0
1 109 0 0 110 1 0
1 110 1 0 153 1 0
0 153 0 0 154 1 0
0 154 0 1 155 1 1
Made with the help of ASCII_only's program generator
///, 82 bytes
/$/NN//#/SSS//"/WWW//!/LLLL/A
"""""""WW
######S
A
!!!
IIIIIIIII
!!!
A
$$$$$$$
DDDD
PHP, 93 bytes
<?=!array_walk(str_split("AWSALILAND",1),function(&$v){echo str_repeat($v,ord($v)-64)."
";});
PHP, 81 bytes
<?php for(;$i++<10;)echo str_repeat(($s=AWSALILAND)[$i-1],ord($s[$i-1])-64)."
";
Java (JDK), 162 bytes
static void m(){String n="AWSALILAND";for(int i=0;i<n.length();i++){char c=n.charAt(i);int v=c;for(int z=0;z<v-64;z++)System.out.print(c);System.out.println("");}
APL(NARS), 22 chars, 44 bytes
⊃a/¨⍨⎕A⍳a←'AWSALILAND'
test
A
WWWWWWWWWWWWWWWWWWWWWWW
SSSSSSSSSSSSSSSSSSS
A
LLLLLLLLLLLL
IIIIIIIII
LLLLLLLLLLLL
A
NNNNNNNNNNNNNN
DDDD
Scala (51 bytes):
"AWSALILAND"map(c=>s"$c"*(c-64)mkString)map println
Scala (41 bytes):
for(c<-"AWSALILAND")println(s"$c"*(c-64))
Z80Golf, 30 bytes
00000000: 2114 007e d640 477e ff10 fd23 3e0a ff7e !..~.@G~...#>..~
00000010: b720 f076 4157 5341 4c49 4c41 4e44 . .vAWSALILAND
Assembly:
ld hl,str ;load address of str
start:
ld a,(hl) ;get current char
sub 64 ;get letter num in alphabet
ld b,a ;store in b
ld a,(hl) ;get current char
print_char:
rst 38h ;print letter
djnz print_char ;repeat print loop b times
inc hl ;increment index of str, to get next char
ld a,10
rst 38h ;print newline
ld a,(hl) ;get current char
or a
jr nz, start ;if current char!=0, keep looping
end:
halt ;end program (if current char==0)
str:
db 'AWSALILAND'
Swift, 95 bytes
"AWSALILAND".unicodeScalars.forEach{print(String(repeating:String($0),count:Int($0.value)-64))}
How?
"AWSALILAND" // Starting string
.unicodeScalars // Convert into a list of unicode values
.forEach { // Loop over each number
print(String( // Create a string
repeating: String($0), // that repeats each character
count: Int($0.value) - 64)) // the unicode value minus 64 (the offset)
}
Java 11, 89 83 82 81 bytes
v->"AWSALILAND".chars().forEach(c->System.out.println(((char)c+"").repeat(c-64)))
-1 byte thanks to @OlivierGrégoire.
Explanation:
v-> // Method with empty unused parameter and no return-type
"AWSALILAND".chars().forEach(c->
// Loop over the characters as integer unicode values
System.out.println( // Print with trailing newline:
((char)c+"") // The current character converted to char and then String
.repeat(c-64))) // repeated the unicode value minus 64 amount of times
JavaScript (Node.js), 65 63 bytes
i=>[...'AWSALILAND'].map(c=>c.repeat(parseInt(c,36)-9)).join`
`
Explanation:
i=> // Prints the result of this function
[...'AWSALILAND'].map(c=> // Loop over the characters
c.repeat( // Repeat the current character
parseInt(c,36)-9))) // Character to alphabetical position
.join`
` // Prints a newline after every new char
Edit: -2 bytes thanks to @BrianH.
C# (Visual C# Interactive Compiler), 61 59 bytes
foreach(var s in"AWSALILAND")WriteLine(new string(s,s-64));
@Kevin Cruijssen Thanks, 2 bytes saved by removing { }
Ruby, 39 bytes
"AWSALILAND".chars{|x|x.*x.ord-64}
Try it offline!
F# (.NET Core), 66 bytes
"AWSALILAND"|>Seq.iter(fun x->printfn"%s"(new string(x,int x-64)))
Same logic than @pocki_c's answer
I am not used to F# golfing. All inputs are welcome :)
C (clang), 96 95 77 73 bytes
*s=L" AWSALILAND";main(i){for(;*++s;puts(""))for(i=*s-63;--i;printf(s));}
-18 bytes thanks to @ErikF
-5 bytes thanks to @ceilingcat
brainfuck, 112 bytes
+++++++[->++>>++>+>++>>+++>+++[<<<]<<]++++>>+>-->++>-->+>-->++>+[[->+>+<<]----[>+<----]>+>[-<.>]++++++++++.<,<<]
The actual word generation can probably be optimised further.
Bubblegum, 29 bytes
00000000: 73e4 0ac7 0eb8 8231 0197 2397 0f12 e0f2 s......1..#.....
00000010: 8401 1461 a02a 3f14 c0e5 0204 00 ...a.*?......
I'm sorry...
PHP, 58 bytes
while($c=AWSALILAND[$i++])echo str_pad("
",ord($c)-63,$c);
prints a leading linebreak. Run with -nr or try it online.
QBasic, 57 bytes
FOR i=1TO 10
c=ASC("AWSALILAND",i)
?STRING$(c-64,c)
NEXT
I'm so glad I was able to avoid using MID$() for this challenge!
How it works
- Run a
FORloop over (1-based) indices of the characters in the string - Store the ASCII code of the current character as
c - Create a string of
c-64repetitions of charactercand print it
Pip -l, 21 bytes
_X A_-64M"AWSALILAND"
"AWSALILAND" Literal string
M to the characters of which we map this function:
A_ ASCII value of character
-64 minus 64 (= 1-based index in alphabet)
_X String-repeat character that many times
Autoprint, with each item on its own line (-l flag)
Go, 100 bytes
import(."fmt"
."strings")
func a(){for _,c:=range"AWSALILAND"{Println(Repeat(string(c),int(c)-64))}}
T-SQL, 83 bytes
SELECT REPLICATE(value,ASCII(value)-64)FROM STRING_SPLIT('A-W-S-A-L-I-L-A-N-D','-')
STRING_SPLIT is supported by SQL 2016 and later.
Jelly, 17 bytes
“þ⁷ʂ:ñ⁵1»O_96׌uY
How?
“þ⁷ʂ:ñ⁵1»O_96׌uY - Main Link: no arguments
“þ⁷ʂ:ñ⁵1» - compressed list of characters (using words aws, ali & land = awsaliland)
O - cast to ordinals = [97,119,115,97,108,105,108,97,110,100]
_96 - subtract 96 = [1,23,19,1,12,9,12,1,14,4]
Œu - upper-case the chain's argument = "AWSALILAND"
× - multiply = ["A","W...W","S...S","A","L...L","I...I","L...L","A","N...N","DDDD"]
Y - join with newline characters = ["A",'\n',"W...W",'\n',"S...S",'\n',"A",'\n',"L...L",'\n',"I...I",'\n',"L...L",'\n',"A",'\n',"N...N",'\n',"DDDD"]
- implicit (smashing) print
Also @ 17 bytes: “þ⁷ʂ:ñ⁵1»ØaiⱮ׌uY, and “þ⁷ʂ:ñ⁵1»O%32׌uY
Common Lisp, 96 bytes
(defun x(s)(dotimes(i(length s))(dotimes(j(-(char-int(char s i))96))(princ(char s i)))(terpri)))
PHP, 71 bytes
<? for($i=0;$c="AWSALILAND"[$i++];)echo str_repeat($c,ord($c)-64)."\n";
K (ngn/k), 23 22 bytes
(32!r)#'r:"AWSALILAND"
r:"AWSALILAND" // set variable r to the string
(32!r) // mod 32 each string in r, the operation will use ASCII number
#' // for each value in the array, take that amount of the corresponding character in the string
Japt, 18 17 bytes
-1 byte from @Shaggy
`awÑ¢Ó`u ¬®pIaZc
`awÑ¢Ó`u ¬®pIaZc Full program
`awÑ¢Ó` Compressed "awasiland"
u uppercase
¨ split and map each letter
p repeat the letter this many times:
a absolute difference of
Zc get charcode
I and 64
R, 64 61 bytes
R's clunky string handling characteristics on full display...
-3 thanks to @Giuseppe, who noticed it's actually shorter to convert a string from utf8 to int and back again than using R's native string splitting function...
write(strrep(intToUtf8(s<-utf8ToInt("AWSALILAND"),T),s-64),1)
Dart, 83 bytes
'AWSALILAND'.runes.forEach((r)=>print(String.fromCharCodes(List.filled(r-64, r))));
Charcoal, 17 bytes
EAWSALILAND×ι⊕⌕αι
Try it online! Link is to verbose version of code. Explanation:
AWSALILAND Literal string
E Map over characters
ι Current character
α Uppercase alphabet
⌕ Find
⊕ Increment
ι Current character
× Repeat
Implicitly print each entry on its own line
MBASIC, 86 bytes
1 S$="AWSALILAND":FOR I=1 TO LEN(S$):P$=MID$(S$,I,1):PRINT STRING$(ASC(P$)-64,P$):NEXT
Output:
A
WWWWWWWWWWWWWWWWWWWWWWW
SSSSSSSSSSSSSSSSSSS
A
LLLLLLLLLLLL
IIIIIIIII
LLLLLLLLLLLL
A
NNNNNNNNNNNNNN
DDDD
Stax, 16 15 bytes
êôM▄╬æ♠ª+ç█○==.
Explanation
`'YHu~{YX#`m64-_]* #Full program, unpacked,
`'YHu~{YX#` #Compressed "AWSALILAND"
m #Use the rest of the program as the block. Print each mapped element with a new-line.
64 #Put 64 on stack
- #Subtract current element by 64
_ #Get current index
] #Make a 1 element array
* #Duplicate that many times
Saved one byte by figuring out that the "*" command works with [arr int] and [int arr].
APL (Dyalog Classic), 22 bytes
A more elegant, tacit solution thanks to Adám!
(↑⎕A∘⍳⍴¨⊢)'AWSALILAND'
Initial solution:
↑a⍴¨⍨⎕A⍳a←'AWSALILAND'
MATL, 20 bytes
'AWSALILAND'"@@64-Y"
Explanation
'AWSALILAND' % Push this string
" % For each character in this string
@ % Push current character
@ % Push current character
64- % Implicitly convert to codepoint and subtract 64
Y" % Repeat that many times. Gives a string with the repeated character
% Implicit end
% Implicit display
SNOBOL4 (CSNOBOL4), 88 bytes
S ='AWSALILAND'
L S LEN(1) . X REM . S :F(END)
&UCASE X @Y
OUTPUT =DUPL(X,Y) :(L)
END
J, 31 bytes
echo(#&>~_64+a.i.])'AWSALILAND'
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)
05AB1E, 17 bytes
.•DθîRI§•ʒAyk>×u,
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.
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
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)
