Posts: 2,765
Threads: 138
Joined: Nov 2002
i need a prog to make this
Code:
A
AA
AAA
B
BA
BAA
C
CA
CAA
...
Z
ZA
ZAA
AB
ABA
BB
BBA
CB
CBA
...
hope thatr helps
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,272
Threads: 36
Joined: Feb 2003
You mean like this?
Code:
DEFINT A-Z
' One letter:
FOR a1 = ASC("A") TO ASC("Z")
PRINT CHR$(a1)
NEXT a1
' Two letters:
FOR a1 = ASC("A") TO ASC("Z")
FOR a2 = ASC("A") TO ASC("Z")
PRINT CHR$(a1) + CHR$(a2)
NEXT a2
NEXT a1
' Three letters:
FOR a1 = ASC("A") TO ASC("Z")
FOR a2 = ASC("A") TO ASC("Z")
FOR a3 = ASC("A") TO ASC("Z")
PRINT CHR$(a1) + CHR$(a2) + CHR$(a3)
NEXT a3
NEXT a2
NEXT a1
Posts: 2,765
Threads: 138
Joined: Nov 2002
close. very very close. it doesn't do spaces like "AA " or "B "
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,272
Threads: 36
Joined: Feb 2003
Do you want a space after each one, or just the ones that are less than 3 letters?
Posts: 2,765
Threads: 138
Joined: Nov 2002
just the ones less than 3 like
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,057
Threads: 156
Joined: Aug 2003
you trying to crack some thing?
Posts: 1,272
Threads: 36
Joined: Feb 2003
Ok, how's this?
Code:
DEFINT A-Z
' One letter:
FOR a1 = ASC("A") TO ASC("Z")
PRINT CHR$(a1) + " "
NEXT a1
' Two letters:
FOR a1 = ASC("A") TO ASC("Z")
FOR a2 = ASC("A") TO ASC("Z")
PRINT CHR$(a1) + CHR$(a2) + " "
NEXT a2
NEXT a1
' Three letters:
FOR a1 = ASC("A") TO ASC("Z")
FOR a2 = ASC("A") TO ASC("Z")
FOR a3 = ASC("A") TO ASC("Z")
PRINT CHR$(a1) + CHR$(a2) + CHR$(a3)
NEXT a3
NEXT a2
NEXT a1
Posts: 2,765
Threads: 138
Joined: Nov 2002
yea thanks. 8) that should do if i have another question ill just post again.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 75
Threads: 11
Joined: Nov 2003
I don't know if you settled on the previous answer or not, but here's another way to do it:
CLS : DIM PZ$(26)
GOSUB LOADER
P1 = 1: N = 1: R = 2: C = 1: RMAX = R + 3
RMIN = R: PT = 16
SHOWIT:
DO WHILE N < 4
LOCATE R, C: PRINT PZ$(P1);
IF N >= 2 THEN PRINT "A"; ELSE
IF N = 3 THEN PRINT "A" ELSE
R = R + 1: N = N + 1
IF R >= RMAX THEN R = RMIN: C = C + 5 ELSE
LOOP
P1 = P1 + 1: N = 1
IF P1 <= PT THEN GOTO SHOWIT ELSE
IF PT = 26 THEN GOTO LOAD2 ELSE
PT = 26: RMIN = R + 4: R = RMIN: RMAX = R + 3: C = 1
GOTO SHOWIT
LOAD2:
GOSUB LOADER
P = 1: N = 1: R = 10: C = 1: RMAX = R + 2
RMIN = R: PT = 16
SHOWIT2:
DO WHILE N < 3
LOCATE R, C: PRINT PZ$(P); PZ$(2);
IF N = 2 THEN PRINT "A" ': P = T: PRINT PZ$(P); PZ$(T);
R = R + 1: N = N + 1
IF R >= RMAX THEN R = RMIN: C = C + 5 ELSE
LOOP
P = P + 1: N = 1
IF P <= PT THEN GOTO SHOWIT2 ELSE
IF PT = 26 THEN GOTO QUIT ELSE
PT = 26: RMIN = R + 4: R = RMIN: RMAX = R + 2: C = 1
GOTO SHOWIT2
END
QUIT:
END
LOADER:
RESTORE
FOR PZ = 1 TO 26
READ PZ$(PZ): NEXT
RETURN
DATA A,B,C,D,E,F,G,H,I,J,K,L,M
DATA N,O,P,Q,R,S,T,U,V,W,X,Y,Z
As you can see it's fairly simple and compact.
adsherm
Posts: 2,765
Threads: 138
Joined: Nov 2002
your prog doesn't show all the combinations.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.