Combinations alphabet?

C

Chris F.A. Johnson

On Sat, 04 Apr 2009 04:32:36 -0500
Hi,

I'am trying to make an HTML programm of all possible combinations in the
Alphabet.

Actually I have that on my CV in the "skills" section.

The code exists of 3 letters.
26*26*26 = 17.576 possibilities!
Is there any possibility to have all combinations with a
programm? AAA, AAB, AAC, …
Many thanks in advance if somebody could help me out.

Here is a Python program to do it:

from string import uppercase as u

for i in range(26):
for j in range(26):
for k in range(26):
print '<span class="code">%s</span>' % (u + u[j] + u[k])


[snip]

PHP version may look something like:

<ol>
<?php

$range = range('A', 'Z');
foreach($range as $A)
foreach($range as $B)
foreach($range as $C)
print "<li>$A$B$C</li>\n";

?>
</ol>


Hell, in run basic I can come up with 3 or 4 ways to do it.
html "<ul>"
For a =64 to 90
for b=64 to 90
for c=64 to 90

show$=chr$(a)+chr$(b)+chr$(c)
html "<li>";show$;"</li>"
next c
next b
next a
html "</ul>"


In the bash shell:

printf "%s\n" {A..Z}{A..Z}{A..Z}
 
R

Raymond Schmit

Hardly.
I suggested PHP in this case because all that you need to do for the
output PHP can handle just as well.

Javascript is also a possibility ..when php is not available on the
server of the webhosting.
 
M

Mike Duffy

That's why I like the simplicity of BASIC.

I'm not sure of your point. She said she forget how to program, so now she
can get all the 3 letter codes she wants just by clicking on the link. What
could be simpler?
 
R

Raymond Schmit

That's why I like the simplicity of BASIC.

Without installing something ?
If the answer is no -> Your RunBasic solution IS NOT as easy :)
Javascript is running without installing something on the client and
without installing something on the webserver.
note for Mike: Good work !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top