# Guess my password! (Code Golf) [duplicate]

So, like the title says, today you are going to guess my password (sort of). You need to make a big long list of every possible password I might be using on my 4 digit online vault.

Specifications:

• It could contain any 26 letters of the alphabet in UPPER CASE.
• It could contain any numbers 0-9.
• So, basically, each digit has 36 different possibilities.
• There are four digits.
• Repeat characters are allowed! (Hint: Sample space is 1,679,616 or 36^4)

Program Requirements/Rules:

• Program must output all possible answers to a text file or to the console, line by line. (One answer per line)
• You may not make use of any premade tools for this (Idk if any exist, but just in case)
• It must generate all 36^4 possible answers

Remember, this is a Code-golf. So shortest answer in bytes wins. Please use the standard title format of ##Language Name, Byte Size. Even if there is a winner, feel free to post your answer. (It's always fun to see the different solutions in different languages).

Edit: Not a duplicate of sugested, mines has different context, and different paremeters. (I require numbers, duplicate characters, and only UPPERCASE)

• I'm not sure if this should be closed as a duplicate of that question; it requires digits as well as letters, so answers can't just be copied over. Then again, it is pretty similar... – ETHproductions Dec 1 '15 at 2:27
• @ETHproductions yeah, IDK. I think its sort of different. I mean, the practice/methods to solve are similar/same but then the application is different. – Ashwin Gupta Dec 1 '15 at 3:28
• Both questions are "Count in base B" for some B. There may be superficial differences, but they're fundamentally the same question. – Peter Taylor Dec 1 '15 at 6:58
• If it didn't have the word "password" in it, there is now way it could be thought of as a copy of that question. Answer to this question in Perl 6 .say for [X~] (0..35)».base(36)xx 4, answer to the other question is say 'a'.../password/ ( or print "\$_ " for 'a'.../password/ if you want it to start printing immediately. ) There is no easy way to answer either question starting out with the answer for the other one. I say remove all mention of the word password, and try to re-open. – Brad Gilbert b2gills Dec 1 '15 at 18:09
• @BradGilbertb2gills thank you. Thats what I'm trying to say here... – Ashwin Gupta Dec 2 '15 at 1:34

# Pyth - 8 bytes

^+jkUTG4

• I'm not entirely sure I understand, the output I got when I ran your program is in pairs of two? I said the password is 4 digit. – Ashwin Gupta Dec 1 '15 at 1:49
• @AshwinGupta yes, because the online interpreter would reject a program with 36^4 permutations. – cat Dec 1 '15 at 1:50
• Ah wait nevermind, I see, you changed the 4 to 2 for running purposes. Sorry my bad. – Ashwin Gupta Dec 1 '15 at 1:50
• I'm afraid to upvote when your score is 7 777 :) – J Atkin Dec 1 '15 at 1:50
• You are currently the winner unless someone can beat you. Where are the Japt and Seriously guys? They both are short-syntax golfing languages with a chance. – Ashwin Gupta Dec 1 '15 at 2:00

mapM(\a->['A'..'Z']++['0'..'9'])"abcd"


yeah, it's not gonna beat Pyth. Oh well...

• Don't worry, not much beats Pyth. from what little I've seen here on CodeGolf SE in the last week or so. Still a great answer. – Ashwin Gupta Dec 1 '15 at 1:56
• :p too true... I'll take beating another non-golf language for now... – Actorclavilis Dec 1 '15 at 1:57
• Well, you beat Ruby! @quartata although it was close. 15 Bytes... – Ashwin Gupta Dec 1 '15 at 2:01

# Ruby, 64 53 bytes

[*'A'..'Z',*'0'..'9'].repeated_permutation(4){|a|p a}


Probably golfable further, I'm not that good at Ruby.