Page 2 of 3

Re: palindromic primes

PostPosted: Fri Nov 18, 2011 11:00 pm
by Ed Goodman
By my calculations, Enrico's good mood lasted eight hours and forty-one minutes.

Re: palindromic primes

PostPosted: Fri Nov 18, 2011 11:12 pm
by enrico-sorichetti
Yep, my good mood disappeared when the TS posted
i don't know c code but it was part of this particular challenge


;)

Re: palindromic primes

PostPosted: Sat Nov 19, 2011 1:06 am
by Akatsukami
BillyBoyo wrote:There's a thought. I could set up one of those for Cobol. I could call it the IOC.... rats.

You just have to think of a COBOL-oriented name. Like the OO version of C is C++, and the OO version of COBOL is ADD 1 TO COBOL GIVING OBJECT-ORIENTED-COBOL :mrgreen:

Re: palindromic primes

PostPosted: Sat Nov 19, 2011 1:19 am
by BillyBoyo
I could cheat, and take the winner of the C thing and use ENTER. Just a pity it was never actually implemented...

I wonder if COBOL is a reserved word?

In a not-necessarily-similar-vein, I like the idea of DATA + ALGORITHMS = S0C7, if either or both do not contain valid numeric data...

Re: palindromic primes

PostPosted: Sat Nov 19, 2011 11:34 am
by dick scherrer
We've heard for many, many years thet the GO TO is "bad" (opinions vary).

With the new OO stuff, might a COME FROM construct in COBOL be handy. Something like the old task / rendezvous. . . 8-)

d

Re: palindromic primes

PostPosted: Sun Nov 20, 2011 5:06 am
by clrgq
lol no ioccc submission, im a total newb

Re: palindromic primes

PostPosted: Sun Nov 20, 2011 5:22 am
by clrgq
and what is wrong with saying i don't know c code? I'm doing a mainframe challenge and the part that i was stuck on contained this small snippet of c code and after reading manuals i still wasn't quite sure which direction to go in. im trying to become familiar with mainframe and not knowing something is not the same thing as incompetence. i'm sure the c code gods will not be angry that i posted for assistance on a help & support forum for mainframe BEGINNERS and Students. i have no desire to be a programmer but that doesnt mean that i'm not allowed to familarize myself with it. The challenge that i am doing is in order to prepare myself for a mainframe class and i figured the more i expose myself to it the better. so i repeat, i do not know c code but i wanted the assistance of people on here who are obviously alot better with coding and more experienced. i didn't ask for a 'handout' and you did not have to do that for me if it offended you that much.

Re: palindromic primes

PostPosted: Sun Nov 20, 2011 6:06 am
by clrgq
enrico-sorichetti wrote:follow on...
no code optimization will make a bad algorithm good

OK for brute force but...

why in heaven test the even numbers ?
is somebody hoping to make a revolutiary discover in mathematics? :geek:

and why in isPrime the limit is number/2+1 instead of sqrt(number) + 1
to check if 999999 is prime it means 500000 divisions instead of 1000

meditate on elementary arithmetic... meditate

What does this even mean? instead of meditating on elementary arithmetic, let me REITERATE, i did not write this code. this is how it was presented to me and for those of us who are doing the challenge we were asked to ALTER is so that palindromic primes are only listed. it is not a c code competition.

Re: palindromic primes

PostPosted: Sun Nov 20, 2011 11:00 am
by dick scherrer
Hello,

From your point of view, what you have asked is completely appropriate.

Many here believe that asking for help when working on a contest is not playing fair (i suspect you won't agree). Especially if this "contest" might lead to employment.

Personally, i have no problem that you are not a c programmer. I'm not either. It may help someone help you if you post the logic of how you would solve the question (using pseudo-code might help). Once you have solved the problem, then real c code modification could be considered.

Re: palindromic primes

PostPosted: Mon Nov 21, 2011 7:30 pm
by clrgq
good point there, but this is purely an extracurricular task. i stand to win no prize, nor gain employment from this. just trying to get a better grasp on mainframes since i signed up for a course in the fall at my university.