CC Weekly Code Challenge Winners

Thank you to everyone for participating in our CC Weekly Code Challenge. Below are the winners for each week’s challenge.

Week 31 Winner: Peter Baston, Flintshire, United Kingdom

Answer: Line 35: Should not end with semi-colon

Week 31 Challenge Code

Week 31 Prize: A Circuit Cellar 2012 & 2011 Archive CD


Week 30 Winner: Gait Boxman, Gelderland, Netherlands

Answer: Line 31: should be digits % 3 instead of digits / 3

Week 30 Challenge Code

Week 30 Prize: An IAR Kickstart: KSK-FM3-48PMC-USB


Week 29 Winner: Gordon Margulieux, Oregon, United States

Answer: Line 10: Conditional should be “if (number == 0)” instead of number < 0

Week 29 Challenge Code

Week 29 Prize: An Elektor 2012 & 2011 Archive DVD


Week 28 Winner: Alvin Schurman, Florida, United States

Answer: Line #35: Missing “, terminate()” before “after 0 -> ok” to recursively kill all (both) processes before ending

Week 28 Challenge Code

Week 28 Prize: A CC T-Shirt and a one year digital subscription/renewal


Week 27 Winner: Brian Shewan, Nova Scotia, Canada

Answer: Line 22: Shift register won’t shift. Change to “ShiftReg_ClkB <= {ShiftReg_ClkB[1:0], clkA_Change}”

Week 27 Challenge Code

Week 27 Prize: Circuit Cellar 2012 & 2011 Archive CDs


Week 26 Winner: Kang Usman, Jakarta, Indonesia

Answer: Line 46: need [ and ]. it should be translate([0,0,2*ThreadThick])

Week 26 Challenge Code

Week 26 Prize: An IAR Kickstart: KSK-FM3-48PMC-USB


Week 25 Winner: Guido Cargnino, Grugliasco, Turin, Italy

Answer: Line #14: *p and *q must be used.

Week 25 Challenge Code

Week 25 Prize: An Elektor 2012 & 2011 Archive DVD


Week 24 Winner: John Safrit, Mebane, North Carolina, USA

Answer: Line#22: need to terminate space string, add: space[d]=’\0′;

Week 24 Challenge Code

Week 24 Prize: A CC T-shirt and a one-year subscription to Circuit Cellar.


Week 23 Winner: Rob Tholl, Calgary, Alberta, Canada

Answer: Line 14: need &array[c] to write to the proper memory location

Week 23 Challenge Code

Week 23 Prize: A CCGold Issues Archive


Week 22 Winner: Mike Brown, Meldreth Cambs, United Kingdom

Answer: Line 9: Use “div.container” to select the div class ‘container’

Note: An acceptable alternate answer was to change the “class” to “id” on line 23 as indicated in the image below. Also, while the omission of the closing anchor tags results in invalid HTML, that code still works as intended. The id/class discrepancy is the part that fails to result in its intended outcome. View the live code here.

Week 22 Challenge Code

Week 22 Prize: An IAR Kickstart: KSK-TMPM061-JL


Week 21 Winner: Brian Shewan, Nova Scotia, Canada

Answer: Line #4 – Missing ‘.’ after ‘PROGRAM-ID’. Change to “PROGRAM-ID. JUST-A-TEST.”

Week 21 Challenge Code

Week 21 Prize: An Elektor 2012 & 2011 Archive DVD


Week 20 Winner: Rudolf Steger, Braunschweig, Germany

Answer: Line 13: the accept statement is missing the “do”

Week 20 Challenge Code

Week 20 Prize: A CC T-Shirt and one year digital subscription/renewal


Week 19 Winner: Kevin Hannan, Marietta, Georgia, USA

Answer: Line 17: WHERE should be HAVING

Week 19 Challenge Code

Week 19 Prize: A CCGold Issues Archive


Week 18 Winner: Laurent Haas, Paris, France

Answer: Line 19 : Should be “write(*,*) average”

Week 18 Challenge Code

Week 18 Prize: An IAR Kickstart: KSK-LPC4088-JL


Week 17 Winner: Carol Willing, Encinitas, California, USA

Answer: Line 6: cons will incorrectly create a list of lists; use append instead for correct recursive reversal of list

Week 17 Challenge Code

Week 17 Prize: An Elektor 2012 & 2011 Archive DVD


Week 16 Winner: William McNamara, The Colony, Texas, USA

Answer: The “do” on line 5 needs to be on a separate line or have a semicolon in front of it

Week 16 Challenge Code

Week 16 Prize: A CC T-Shirt and one year digital subscription/renewal


Week 15 Winner: Jesper Poulsen, København, Denmark

Answer: Line 23: Should be 0..@list-2 to avoid array overrun when taking $list[$i+1]

Week 15 Challenge Code

Week 15 Prize: A CCGold Isues Archive


Week 14 Winner: Carl Hage, California, USA

Answer: Line 11: Need + int($year/400) not – int($year/400)

Week 14 Challenge Code

Week 14 Prize: An IAR Kickstart: KSK-STM32F407ZG kit.


Week 13 Winner: Raffi Tchoboian, Vienne, France

Answer: Line 16: the position of the last char in the String s is length-1 so the correct line 16 is : “swap(&s[i], &s[length-i-1]);”

Week 13 Challenge Code

Week 13 Prize: A CC T-shirt and the CC25 Anniversary Edition


Week 12 Winner: Andrew Boelbaai, Texas, United States

Answer: Line 10: J is not incrementing and causing an infinite loop. Must be for(j=0;j<count;sum +=data[j++])

Week 12 Challenge Code

Week 12 Prize: An Elektor 2012 & 2011 Archive DVD


Week 11 Winner: Laurent Haas, Paris, France

Answer: Line 6: reverse must be initialized to 0 => int reverse = 0;

Week 11 Challenge Code

Week 11 Prize: A CC T-shirt and The CC25 Anniversary Edition


Week 10 Winner: Michael Welle, Baden-Württemberg, Germany

Answer: Line 15: strcmp returns 0 if both strings are equal. On the other hand 0 is interpreted as false in C, so the condition is wrong. if (strcmp(a,b)==0)

Week 10 Challenge Code

Week 10 Prize: An IAR Kickstart: KSK-LPC4088-JL


Week 9 Winner: Jon Chapman, Ohio, United States

Answer: Line 24: bgcolor tag is misspelled as ‘bgoclor’. It needs corrected to ‘bgcolor’

Week 9 Challenge Code

Week 9 Prize: A CCGold Issues Archive


Week 8 Winner: Marcelo Jimenez, Rio de Janeiro, Brazil

We stumped the coding community! No one got the correct answer, so we’ve selected one random winner to receive a CC Tag Cloud t-shirt. The language is Burroughs Corporation “Enhanced” Algol, a rather obscure language these days, though Algol variants were important in their time and are still discussed today in terms of their influence on the structure of subsequent programming languages. The correct answer was: Line 4: incorrect exponent character – it should be “2.99792458@8″

Week 8 Challenge Code


Week 7 Winner: Alex Ivopol, Wellington, New Zealand

Answer: Line 16: the double ampersand is a logical operator that returns true as long as k is non zero. The intended operator here is a single ampersand which is a bitwise operator used to test the least significant bit of k

Week 7 Challenge Code

Week 7 Prize: An IAR Kickstart KSK-TMPM061-JL kit


Week 6 Winner: Colm Baston, Flintshire, UK

Answer: Line 7: (c == *s++) is comparing the values of c and *s rather than assigning: It should be (c = *s++)

Week 6 Challenge Code

Week 6 Prize: An Elektor 2012 & 2011 Archive DVD


Week 5 Winner: Antonios Chorevas, Attiki, Greece

Answer: Line 04: (x*x) must be replaced by ((x)*(x)) because there is problem with the priority of the operations

Week 5 Challenge Code

Week 5 Prize: A CC “Tag Cloud” T-shirt and a hardcopy of the CC25 Anniversary Issue


Week 4 Winner: Heinz Nickisch, Bavaria, Germany

Answer: Line 37: BEGIN instead of BEING

Week 4 Challenge Code

Week 4 Prize: An IAR Kickstart kit


Week 3 Winner: Chu Tin Teng, Fremont, CA

Answer: Line 7: string comparison should use cmp, instead of <=>. New line should read as “($aa cmp $ba) || ($an <=> $bn)”.

Week 3 Challenge Code

Week 3 Prize: A CC T-Shirt and one year digital subscription/renewal to Circuit Cellar.


Week 2 Winner: Chris Austen, South Yorkshire, UK

Answer: Line 5: ROT should be SWAP ROT for the given stack effect – though -ROT will work too

Week 2 Challenge Code

Week 2 Prize: CC Gold issue archive on a USB drive.


Week 1 Winner: Peter Baston, Flintshire, UK

Answer: Line 9: There should not be a “*” before argv[i]

Week 1 Challenge Code

Week 1 Prize: IAR Kickstart: KSK-LPC4088-JL