help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parse Error


From: Doug Stewart
Subject: Re: Parse Error
Date: Thu, 22 Sep 2016 21:40:32 -0400



On Thu, Sep 22, 2016 at 9:17 PM, Nicholas Jankowski <address@hidden> wrote:

On Sep 22, 2016 5:33 PM, "platinumrecord" <address@hidden> wrote:
>
> Hello, I'm currently trying to create a code for the Collatz Conjecture. I've
> been receiving a parse error and for the life of me cannot figure out where
> it's coming from. Please help if you can!
>
> function[]=collatz3(n)
> loopcount=0;
> while n ~= 1
>   loopcount=loopcount + 1;
>   if IsEven(n)==1
>     n=(n/2);
>   else
>     n=((n*3)+1);

you need an endif   here
 

> endwhile;
> print(loopcount);
> end;
>
>

Please reply with the exact command you use to call the function and the exact error message you receive.


_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave




--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]