Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.maple > #239
| From | "I.N. Galidakis" <morpheus@olympus.mons> |
|---|---|
| Newsgroups | comp.soft-sys.math.maple |
| Subject | Re: Supressing Set statements |
| Date | 2011-09-17 02:13 +0300 |
| Organization | Chaos ->|<- http://ioannis.virtualcomposer2000.com/ |
| Message-ID | <1316214793.495442@athprx03> (permalink) |
| References | <1316204866.109484@athprx04> <87ty8c2jqi.fsf@san.rr.com> |
Joe Riel wrote:
> "I.N. Galidakis" <morpheus@olympus.mons> writes:
>
>> Hi everyone,
>>
>> Does anyone know how to suppress set statements on the output?
>>
>> I have the following declarations in Maple 9:
>>
>> E:={}:#board encodings
>>
>> and later on, in a procedure, I augment E by the current board
>> encoding:
>>
>>> move:=proc(p,q,n,c1,r1,c2,r2)
>>> global E;
>>> if p[c1,r1]<>[] then
>>> if n<>0 then rotate(p,c1,r1,n);fi;
>>> if fits(p,q,c1,r1,c2,r2) then
>>> q[c2,r2]:=p[c1,r1];#set to puzzle
>>> p[c1,r1]:=[];#remove from board
>>> print("moving:",n,c1,r1,"->",c2,r2);
>>> stack[push]([n,c1,r1,c2,r2], S);#push into stack of moves
>>> E:=E union {enc(q)}:#add new state to set of states
>>> else
>>> print("Illegal move!");
>>> fi;
>>> else
>>> print("Source is empty!");
>>> fi;
>>> end:
>>
>> In my loop, I call:
>>
>>> while pef(q)<202 do
>>> gen(p,q);#creates G
>>> while G=[] do
>>> undo(p,q):
>>> gen(p,q):
>>> od;
>>> bm:=pick(p,q):
>>> while bm=0 do
>>> undo(p,q):
>>> gen(p,q):
>>> bm:=pick(p,q):
>>> od;
>>> #print("Picking move in G:",bm,nops(NE));
>>> #print("Generated:",G);print("New States:",NE);
>>> move(p,q,G[bm][1],G[bm][2],G[bm][3],G[bm][4],G[bm][5]):
>>> od;
>>
>> When I run the above loop, I get a repeated and growing set E on the
>> output, DESPITE having supressed all statements relating to E, which
>> I don't want to see (unless I am debugging) because it contains very
>> big numbers, is very big in size and slows Maple down a lot, because
>> this is a puzzle search, so it can take zillions of tries.
>>
>> How can I suppress the output of the set E?
>>
>> Maybe if I declare it as something else? A list?
>
> A colon as line terminator to suppress output only has an effect
> at the outermost level. Here you would suppress all output in the
> loop by terminating the final 'od' with a colon. The colons
> on the statements inside the loop might as well be semicolons.
Thanks. A colon on the last loop did it.
--
I.
Back to comp.soft-sys.math.maple | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Supressing Set statements "I.N. Galidakis" <morpheus@olympus.mons> - 2011-09-16 23:27 +0300
Re: Supressing Set statements Joe Riel <joer@san.rr.com> - 2011-09-16 15:41 -0700
Re: Supressing Set statements "I.N. Galidakis" <morpheus@olympus.mons> - 2011-09-17 02:13 +0300
Re: Supressing Set statements Philo D <doozy@earthling.net.invalid> - 2011-09-17 07:54 -0600
csiph-web