Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I'm lazy, do this for me, seriously.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
octopi




PostPosted: Sun Mar 21, 2004 12:57 pm   Post subject: I'm lazy, do this for me, seriously.

Okay, I'm tired and lazy, and its simple, and I can't figure this out.

I have 3 options, and I have 3 items.
Each Item can have one of the 3 options, only one.
so I've got this matrix thing.

Can someone make me a program that will show like the three items, and each possible option

code:

1 a
2 a
3 a

1 a
2 a
3 b

1 a
2 a
3 c
..


I'm pretty sure there should be 27 different combinations.
But I can't for the life of my figure out how to make a program that displays them all. (I haven't slept more then 8 hours total in the last 4 days Smile)
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Mar 21, 2004 2:11 pm   Post subject: (No subject)

Laughing octopi, get some sleep Laughing
code:

for a : ord ("a") .. ord ("c")
    for b : ord ("a") .. ord ("c")
        for c : ord ("a") .. ord ("c")
            put "1:", chr (a)
            put "2:", chr (b)
            put "3:", chr (c)
            put ""
        end for
    end for
end for
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: