Subject: For Loop Trouble mistake in previous e mail
From: Stavros Macrakis
Date: Mon, 11 Feb 2013 08:15:14 -0800
Your emails are all cut off, so we can't see what you're doing.
This works fine for me in wxMaxima:
(%i1) for i thru 3 do for j thru 3 do print([i,j]);
[1,1]
[1,2]
[1,3]
[2,1]
[2,2]
[2,3]
[3,1]
[3,2]
[3,3]
(%o1) done
It also works fine with parentheses around the bodies of the "do" part.
Do simpler things work for you? e.g.
print([2,3])
for i thru 3 do print(i)
how about
for i thru 21 do for j thru 21 do if mod(i,j)=0 and j<i/2 then print([i,j]);
What version of wxMaxima are you running? What does bug_report() display?
What does "I get no result" mean? What result do you expect?
-s
On Fri, Feb 8, 2013 at 10:39 AM, Ben Blomberg <bblomberg1 at niu.edu> wrote:
> Sorry I sent an e-mail and a large part of it got cut off. It should have
> read.
>
>
> I am trying to write a loop in maxima that will iterate i through values
> of 1 to 21, for each individual value of i the variable j is is iterated
> through values of 1 to 21. At every value of j the two are compared against
> each other and if i
>
>
> for i:1 while i<=21 do(for j:1 while j<=21 do (if i
>
>
> I get no result in wx maxima. Its like it does not even see the code.
> Any thoughts?
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>