Re: Requesting help again... as a beginner....
- Posted by Mattymatt Jun 04, 2009
- 937 views
<snip>
Alright, thanks. Is there a way to copy the code out of the editor, so I don't have to retype it?
Which editor?
If it's the Euphoria "ed", then you have to go over to the left top of the cmd window, click on the icon there, select first "edit", then "mark", use the cursor to mark the section you want to copy, then go back to that icon at the top left, select "edit" and then "copy"; that will put the marked portion into the "clipboard",(you have to make sure to go as far to the right side as necessary, to get full extent of all lines), then here in a post just press <ctl>V to put what you copied into a post here.
Anyways, heres what I got so far, but I have this ex.err that keeps saying I should have end instead. Heres just the segment of it that it reads up to.
sequence t integer h, e t = {1,10000} while t = {1,10000} do t = prompt_number("\nPlease enter a positive odd number.") if t <= 2 then puts(1,"\nThat is an unusable number.") t = {1,10000} else t = and_bits(t,1) power(t,2) = h ____________________ puts(1,h)
(I didn't know how to indent in eucode) The ex.err shows
power(t,2) = h
^ is under r at power.
expected to see possible 'end', not a function.
the code under the line is part of the code after the problem. Why does it want me to put end there? shouldn't it be so it can do the next function?
power is a function, not a procedure, your code there needs to be:
h = power(t,2)
I'm not sure if it's adequate to have "h" be an integer, though, because you could be raising decimal fractions to a power, and the result of that won't be integer type. So maybe you need "h" to be atom, I'm not sure.
Dan
Yes, Euphoria editor. Okay, answered all the questions I could find, see anybody elses' euler?