Singular
https://www.singular.uni-kl.de/forum/

Prompt "Display all 225 possibilities?"
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2216
Page 1 of 1

Author:  CtrlAlt [ Thu Jan 24, 2013 6:12 pm ]
Post subject:  Prompt "Display all 225 possibilities?"

Hello,

always I try to complie my code I get a strange prompt like "Display all 225 possibilities? (y or n)". You can see it on this screen:
Image

Here is my code:
Code:
LIB "poly.lib";
proc DivAlgo(list L) {
   poly p = L[1];
   list a = list(0:size(L));
   L = delete(L, 1);
   while(p != 0) {
      poly LTp = lead(p);
      int flag = 0;   
      for(int i = 0; i < size(L); i++) {
         if(gcd(LTp, L[i]) != 1) {
            p = p - (LTp/lead(L[i])) * L[i];
            a[i] = a[i] + LTp/lead(L[i]);
            flag = 1;
            break;
         };
      };
      if(flag == 0) {
         p = p - LTp;
         a[size(a)] = a[size(a)] + LTp;
      };
   };
   return(a);
};


I found out, that the message appears after the while-loop. I shorted the code on the screen.
But what's the reason? Can someone help me?

Best regards!

Author:  vinay [ Fri Jan 25, 2013 6:30 am ]
Post subject:  Re: Prompt "Display all 225 possibilities?"

Its because of your editor and the way you have written your code. Most probably you have pressed "tab" for alignment during while loop. On Singular command prompt if you press "tab" key twice, you will get the same message.

If you replace "tab" with spaces in your file, then this message will go away.

Hope this helps.

VInay

Author:  CtrlAlt [ Sat Jan 26, 2013 2:42 pm ]
Post subject:  Re: Prompt "Display all 225 possibilities?"

Thanks a lot!

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/