The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

HHC2012 programming challenge??
Message #1 Posted by Pal G. on 24 Sept 2011, 3:47 p.m.

Gene, did you have time to include us in the programming challenge?

      
Re: HHC2012 programming challenge??
Message #2 Posted by Walter B on 24 Sept 2011, 4:11 p.m.,
in response to message #1 by Pal G.

hehe, they claim having discovered particles travelling faster than light, but not *as* fast! A whole year, omg ;-)

            
Re: HHC2011! programming challenge??
Message #3 Posted by Pal G. on 24 Sept 2011, 4:19 p.m.,
in response to message #2 by Walter B

Walter, it was you who caught my last error calling the conference from five years ago HHC1997..

I don't need any more calculators, I need a good watch..

Edited: 24 Sept 2011, 4:21 p.m.

      
Re: HHC2011 programming challenge. Here you go!
Message #4 Posted by Egan Ford on 24 Sept 2011, 5:31 p.m.,
in response to message #1 by Pal G.

From Gene, "Sorry for being late. No WiFi or network access here."

http://xmission.com/~egan/2011_Programming_Contest.pdf

Edited: 24 Sept 2011, 5:35 p.m.

            
Re: HHC2011 programming challenge?? Here you go!
Message #5 Posted by Gene wright on 24 Sept 2011, 5:35 p.m.,
in response to message #4 by Egan Ford

Thanks for posting this

This morning was much more hectic than I had predicted

So far no corrections have been seen to the information in the document ... So the contest is now open

Remember ... Please do not post solutions and probably don't post many questions publicly either! :-)

Sorry for the delay and thanks again Egan!

                  
Re: HHC2011 programming challenge?? Here you go!
Message #6 Posted by Thomas Radtke on 25 Sept 2011, 4:32 a.m.,
in response to message #5 by Gene wright

Hi Gene,

where to post the programs? I used your email address, hope that's ok.

Thomas

                        
Re: HHC2011 programming challenge?? Here you go!
Message #7 Posted by Gerson W. Barbosa on 25 Sept 2011, 3:17 p.m.,
in response to message #6 by Thomas Radtke

Hello Thomas,

Here are my results, no spoiler:

     1 R/S ->           4       (   -  ,    2.2 s)
     5 R/S ->          88       (   -  ,    5.6 s)   
   540 R/S ->      9#8#6#       ( 6.8 s,  407.0 s)
  5000 R/S ->    #8#5#6#0       (60.3 s,    -    )

(timings on the 12C+ and 12C, respectively)

If they are correct, the following is a nice approximation:

n = r*(pi*r + 4)

Regards,

Gerson.

Edited: 25 Sept 2011, 3:31 p.m.

                              
Re: HHC2011 programming challenge?? Here you go!
Message #8 Posted by Werner on 25 Sept 2011, 3:38 p.m.,
in response to message #7 by Gerson W. Barbosa

Would posting the result for 540 constitute a spoiler? The number of pixels is what it is. Whether you reach that answer in 10 seconds or in 1000 seconds is more of a spoiler ;-)

Werner

                              
Re: HHC2011 programming challenge?? Here you go!
Message #9 Posted by Thomas Radtke on 25 Sept 2011, 3:40 p.m.,
in response to message #7 by Gerson W. Barbosa

Hi Gerson,

the 32SII does R=5 in a fraction of a second. It's quite a fast baby :-). Just tried R=540 w/o precise timing, might be about 40s, same digits as you got.

Ah, why couldn't HP just produce the Pionieers and Voyagers forever... ;-(

Thomas

                              
Re: HHC2011 programming challenge?? Here you go!
Message #10 Posted by Dieter on 25 Sept 2011, 4:28 p.m.,
in response to message #7 by Gerson W. Barbosa

But Gerson, what about the center coordinates? The text of the challenge says that the radius as well as x_center and y_center must be entered. :-)))

Anyway, I do not know if your results are correct but at least I get the same on the 35s. ;-) Running times are quite exactly 10x those of the fast 12C+, resp. the 35s is 6x as fast as the original 12C.

Dieter

                                    
Re: HHC2011 programming challenge?? Here you go!
Message #11 Posted by Gerson W. Barbosa on 25 Sept 2011, 4:41 p.m.,
in response to message #10 by Dieter

Quote:
But Gerson, what about the center coordinates?

That's something I haven't understood. Because of the statement "assume that all circles fit on the display panel even if in reality they would not" it appears to me the coordinates are irrelevant. If only the pixels that fit on the screen should be computed, then the coordinates would be important. I may be wrong however.

Cheers,

Gerson.

                                          
Re: HHC2011 programming challenge?? Here you go!
Message #12 Posted by Dave Shaffer (Arizona) on 25 Sept 2011, 4:48 p.m.,
in response to message #11 by Gerson W. Barbosa

I agree with Gerson - the center coords don't matter for counting (theoretical) pixels.

                                          
Re: HHC2011 programming challenge?? Here you go!
Message #13 Posted by Dieter on 25 Sept 2011, 4:51 p.m.,
in response to message #11 by Gerson W. Barbosa

Well, I understood it that way either. So any solution should start with 2x RDN or DROP. ;-)
Either we miss something here ...or we are simply too clever. :-)

Dieter

                                                
Re: HHC2011 programming challenge?? Here you go!
Message #14 Posted by Gerson W. Barbosa on 25 Sept 2011, 5:02 p.m.,
in response to message #13 by Dieter

Quote:
So any solution should start with 2x RDN or DROP. ;-)

You're right. This makes my 12C program two steps longer (48 instead of 46). I thought of including Rv Rv in the beginning, but as it worked with the sample cases I just ignored it. Now checking the rules I see the radius should be entered first... That's how I got B- instead of B at school, by not reading the questions carefully :-)

Edited: 25 Sept 2011, 5:04 p.m.

                                                
Re: HHC2011 programming challenge?? Here you go!
Message #15 Posted by Paul Dale on 25 Sept 2011, 5:06 p.m.,
in response to message #13 by Dieter

Definitely agreed here. In the case of the 34S, a complex roll down or complex drop at the start.

- Pauli

                                                      
Re: HHC2011 programming challenge?? Here you go!
Message #16 Posted by Jeff O. on 27 Sept 2011, 7:25 p.m.,
in response to message #15 by Paul Dale

Or a RCL Z?

                                                            
Re: HHC2011 programming challenge?? Here you go!
Message #17 Posted by Paul Dale on 27 Sept 2011, 7:39 p.m.,
in response to message #16 by Jeff O.

Yes. Or complex x<>y; complex R^ (default state being specified which is 4 level stack) or even x<> Z. I've probably still missed some options.

They'll all run sufficiently fast to make no noticeable difference to the execution time.

- Pauli

                              
Re: HHC2011 programming challenge?? Here you go!
Message #18 Posted by Paul Dale on 25 Sept 2011, 8:52 p.m.,
in response to message #7 by Gerson W. Barbosa

34S after an integer mode bug fix to the firmware and I'm getting 7.6 seconds for r = 5,000. Without the fix and sticking to the same algorithm in floating point mode, 32.7 seconds for r = 5,000.

My best attempt (which is slightly broken but not due to a firmware issue and likely in a fixable way) 4.7 seconds for r = 5,000.

- Pauli

            
Re: HHC2011 programming challenge. Here you go!
Message #19 Posted by Paul Dale on 24 Sept 2011, 7:37 p.m.,
in response to message #4 by Egan Ford

Time to add a special integral area of a circle function to the 34S ;-)

- Pauli

                  
Re: HHC2011 programming challenge. Here you go!
Message #20 Posted by Gene wright on 24 Sept 2011, 8:16 p.m.,
in response to message #19 by Paul Dale

Nope, the contest rules specifically prohibit new code or binaries including new functions not present yesterday

:-)

                        
Re: HHC2011 programming challenge. Here you go!
Message #21 Posted by Paul Dale on 24 Sept 2011, 8:57 p.m.,
in response to message #20 by Gene wright

I noticed that but had to say it anyway :)

I might have found another bug in the firmware too :-( Still investigating. Sigh. This task never ends.

- Pauli

                              
Re: HHC2011 programming challenge. Here you go!
Message #22 Posted by Marcus von Cube, Germany on 25 Sept 2011, 3:24 a.m.,
in response to message #21 by Paul Dale

Quote:
I might have found another bug in the firmware too :-( Still investigating. Sigh. This task never ends.
Can you elaborate on this?
                                    
Re: HHC2011 programming challenge. Here you go!
Message #23 Posted by Paul Dale on 25 Sept 2011, 3:34 a.m.,
in response to message #22 by Marcus von Cube, Germany

Nope. Not without revealing things that will help others :-)

- Pauli

                                          
Re: HHC2011 programming challenge. Here you go!
Message #24 Posted by Marcus von Cube, Germany on 25 Sept 2011, 3:36 a.m.,
in response to message #23 by Paul Dale

Off to bed...

            
Re: HHC2011 programming challenge. Here you go!
Message #25 Posted by Walter B on 25 Sept 2011, 11:55 a.m.,
in response to message #4 by Egan Ford

Just a remark: IMHO, 8 pixels less would give a better circle in the case shown in the picture. But it would complicate the challenge, so take it just FWIW.

                  
Re: HHC2011 programming challenge. Here you go!
Message #26 Posted by Thomas Radtke on 25 Sept 2011, 12:17 p.m.,
in response to message #25 by Walter B

For a certain feature, it could even be a square package of pixels to be as much a circle as the fit given ;-).

                        
Re: HHC2011 programming challenge. Here you go!
Message #27 Posted by Walter B on 25 Sept 2011, 12:23 p.m.,
in response to message #26 by Thomas Radtke

Yeah, I think any pixel should be lit only if the circle covers more than 50% of it, but - as mentioned above - this condition would raise the level of complexity significantly.

                              
Re: HHC2011 programming challenge. Here you go!
Message #28 Posted by Thomas Radtke on 25 Sept 2011, 12:29 p.m.,
in response to message #27 by Walter B

I know what you meant, I was just fooling around to compensate the frustration for not being at the HHC :-/.

                              
Re: HHC2011 programming challenge. Here you go!
Message #29 Posted by Paul Dale on 25 Sept 2011, 5:02 p.m.,
in response to message #27 by Walter B

I don't believe it complicates the problem all that much.

My fastest solution does just this and since I've put too much time into this little puzzle already, I'm not planning on fixing it.

- Pauli


[ Return to Index | Top of Index ]

Go back to the main exhibit hall