
-----------------------------------
mercuryy
Wed Mar 02, 2005 5:47 pm

multiplcation table
-----------------------------------
How can you make a multiplicaiton table using turing loop structure.

e.g. 1 2 3  4  5  6  7
      2 4 6  8 10 12 14
      3 6 9 12 15 18 21

thanks in advance

-----------------------------------
person
Wed Mar 02, 2005 5:49 pm


-----------------------------------
this is actually quite easy


for x : 1 .. 9
    for y : 1 .. 9
        put x * y
    end for
end for


-----------------------------------
mercuryy
Wed Mar 02, 2005 5:51 pm


-----------------------------------
yea. i know how to calculate the result. but i'am not sure how to make it the position that i wanted to be in my post.

-----------------------------------
mercuryy
Wed Mar 02, 2005 5:58 pm


-----------------------------------
like this:

1 2 3 4 
2 4 6 8 
3 6 9 12

-----------------------------------
person
Wed Mar 02, 2005 6:11 pm


-----------------------------------

var b := 0
var a := 1
for x : 1 .. 9
    for y : 1 .. 9
        b += 2
        locate (a, b)
        put x * y
        if b = 8 then
            b := 0
            a += 1
        end if
    end for
end for


i dont know if its wat u want

hope this helps

-----------------------------------
Flikerator
Wed Mar 02, 2005 6:21 pm


-----------------------------------
like this:

1 2 3 4 
2 4 6 8 
3 6 9 12

That is a strange way to do a multiplication table...

-----------------------------------
person
Wed Mar 02, 2005 6:35 pm


-----------------------------------
its wat he wants though

-----------------------------------
Andy
Wed Mar 02, 2005 6:38 pm


-----------------------------------
errr wtf is that?


for x : 1 .. 9
    for y : 1 .. 9
        put x * y : 3..
    end for
    put ""
end for


-----------------------------------
mercuryy
Wed Mar 02, 2005 6:40 pm


-----------------------------------
actually this is not exable what i want.  :oops: . but thanks for trying. Look at


http://renew.education.ucsb.edu/downloads/overheads_handouts/MultiplicationTable.jpg

for the multiplication i want.  :lol:

-----------------------------------
mercuryy
Wed Mar 02, 2005 6:47 pm


-----------------------------------
actually. sorry guys. I got it. it is just a  calculating mistake. thank you all who tries to help.  :oops:

-----------------------------------
person
Wed Mar 02, 2005 7:07 pm


-----------------------------------

errr wtf is that? 

Code: 

for x : 1 .. 9 
    for y : 1 .. 9 
        put x * y : 3.. 
    end for 
    put "" 
end for 


i truely feel stupid right now

-----------------------------------
Flikerator
Wed Mar 02, 2005 7:09 pm


-----------------------------------
Why you feel stupid? Mercuryy made it sound like he wanted some sort of wierd looking table, and it turned out to be a normal muliplication table...

-----------------------------------
jamonathin
Wed Mar 02, 2005 10:24 pm


-----------------------------------
picky, picky, mercuryy...

-----------------------------------
person
Thu Mar 03, 2005 4:17 pm


-----------------------------------
i felt stupid becasue my code was sooo long.....long......long....and stupid

-----------------------------------
jamonathin
Fri Mar 04, 2005 6:44 am


-----------------------------------
don't feel dumb cuz u tried sumthin

-----------------------------------
Drakain Zeil
Fri Mar 04, 2005 6:58 am


-----------------------------------
Don't worry about it, I overcomplicate things all the time because it's the first thing that I think of v.v

-----------------------------------
illu45
Wed Mar 09, 2005 6:12 pm


-----------------------------------
Heh.. yeah, I treid to make one and I had like 6 for loops, and I was using locate command... So... yeah, I really overcomplicated that one :)...

The only problem is with Andy's code is that if you go into 2-digi numbers (a 12 x 12 table), the numbers tend to be too close together. (e.g. 10*10 = 90100110 etc. And it becomes difficult to differentiate. Though that can be fixed by changing  put x * y : 3..  to  put x * y : 4.. 

-----------------------------------
ssr
Wed Mar 09, 2005 9:19 pm


-----------------------------------
ummm r we doing his hwk or something?
but anyway
help eh
 :)  8)

-----------------------------------
Token
Thu Mar 10, 2005 11:52 am


-----------------------------------
Hmm i would have thaught to use a locate command also, but that seems to get the job done quite well, after seing this i'm working on adding more code to make it so that when your mouse is over one of the columns it highlights it yellow, that way you can find where they meet easier, i'll post it here when i'm done
