Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › The Programming Challenge Master Thread
New Posts  All Forums:Forum Nav:

The Programming Challenge Master Thread

post #1 of 256
Thread Starter 
Hello guys!

The old "Programming Challenge" thread is quite outdated and desperately needs to be updated for this decade!tongue.gif I, therefore, have created a new thread.

We have some programmers on this site and it would be good to kick off these programming challenges again.


Note about challenge : This is geared toward beginner or intermediate programmers. The challenges will be easy, yet hard enough to be challenging for beginners. There will be no restriction to which languages you can use. You can use an online compiler to show that it executes and you can post your code here.
Each challenge will have a time duration of about a week so be sure to submit your entry within that time.
Thank you.


LATEST PROGRAMMING CHALLENGE: Challenge # 7 posted!


List of all programming challenges yet: (Click to show)

If you are participating, add in your name HERE




~ {Unregistered}
Edited by {Unregistered} - 12/5/12 at 3:22pm
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #2 of 256
Thread Starter 
Okay, so honestly the poll turn out is better than I expected. thumb.gif

I'll try to issue the first programming challenge by today or tomorrow but I'd like to tell you guys that I'm a little busy during this week and can only guarantee that I'll issue the challenge by the end of this week.

If any of you guys want to volunteer and post the challenge or would like to contribute in any way, then do post here.

By the way, this is also an extra bump to make sure more people see this. smile.gif

Hopefully, this will be up and running by today! thumb.gif
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #3 of 256
How advanced will the challenges be? I have taken intro to C++, c, and Java. Will that be enough or is this aimed towards advanced programmers?
My rig
(18 items)
 
  
CPUMotherboardGraphicsRAM
4770k M power EVGA GTX 580 SC G.SKILL Sniper (2 x 4GB) DDR3 1600 9-9-9-24 
Hard DriveCoolingOSMonitor
512GB Samsung 940 Pro h100 Windows 8 Home premium Asus VG248QE 
MonitorKeyboardPowerCase
Asus VG248QE Corsair K90 Kingwin Lazer Gold 850w Fractal Design Arc Midi R2 
MouseMouse PadAudioAudio
Logitech G700s Corsair Asus Xonar M-Audio BX5 d2 
Audio
krk 10s 
  hide details  
Reply
My rig
(18 items)
 
  
CPUMotherboardGraphicsRAM
4770k M power EVGA GTX 580 SC G.SKILL Sniper (2 x 4GB) DDR3 1600 9-9-9-24 
Hard DriveCoolingOSMonitor
512GB Samsung 940 Pro h100 Windows 8 Home premium Asus VG248QE 
MonitorKeyboardPowerCase
Asus VG248QE Corsair K90 Kingwin Lazer Gold 850w Fractal Design Arc Midi R2 
MouseMouse PadAudioAudio
Logitech G700s Corsair Asus Xonar M-Audio BX5 d2 
Audio
krk 10s 
  hide details  
Reply
post #4 of 256
Thread Starter 
Quote:
Originally Posted by Kyleinator View Post

How advanced will the challenges be? I have taken intro to C++, c, and Java. Will that be enough or is this aimed towards advanced programmers?

No, this is geared toward beginner or intermediate programmers. The challenges will be easy, yet hard enough to be challenging for beginners. There will be no restriction to which languages you can use. You can use an online compiler to show that it executes and you can post your code here.

Glad you asked; I think I should add this to the OP.
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #5 of 256
Awesome this looks like it will be fun!
My rig
(18 items)
 
  
CPUMotherboardGraphicsRAM
4770k M power EVGA GTX 580 SC G.SKILL Sniper (2 x 4GB) DDR3 1600 9-9-9-24 
Hard DriveCoolingOSMonitor
512GB Samsung 940 Pro h100 Windows 8 Home premium Asus VG248QE 
MonitorKeyboardPowerCase
Asus VG248QE Corsair K90 Kingwin Lazer Gold 850w Fractal Design Arc Midi R2 
MouseMouse PadAudioAudio
Logitech G700s Corsair Asus Xonar M-Audio BX5 d2 
Audio
krk 10s 
  hide details  
Reply
My rig
(18 items)
 
  
CPUMotherboardGraphicsRAM
4770k M power EVGA GTX 580 SC G.SKILL Sniper (2 x 4GB) DDR3 1600 9-9-9-24 
Hard DriveCoolingOSMonitor
512GB Samsung 940 Pro h100 Windows 8 Home premium Asus VG248QE 
MonitorKeyboardPowerCase
Asus VG248QE Corsair K90 Kingwin Lazer Gold 850w Fractal Design Arc Midi R2 
MouseMouse PadAudioAudio
Logitech G700s Corsair Asus Xonar M-Audio BX5 d2 
Audio
krk 10s 
  hide details  
Reply
post #6 of 256
I'm looking forward to the first challenge.biggrin.gif
    
CPUMotherboardGraphicsRAM
AMD FX-8320 3.5Ghz @ 3.5ghz Gigabyte 990FXA-UD3 Gigabyte 6850 OC windforce 1GB GDDR5  8GB (2x4GB) G.SKILL RipjawsX F3-12800CL9D-8GBXL 
Hard DriveHard DriveHard DriveCooling
2TB Caviar Green 250GB Hitachi 64GB Crucial M4 Noctua D14 
OSMonitorMonitorMonitor
Linux + Windows 7 64Bits LG Flatron Wide 20.1" 1680x1050 LG Flatron W2442PA 24" 1080p Samsung B2430HD 24 With TV Tuner 1080p 
KeyboardPowerCaseMouse
CM Quickfire Rapid Blue Corsair TX750V2 CM 690 II Logitech G5 
Mouse PadAudio
Steelseries QCK Cloth medium Logitech x-540 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
AMD FX-8320 3.5Ghz @ 3.5ghz Gigabyte 990FXA-UD3 Gigabyte 6850 OC windforce 1GB GDDR5  8GB (2x4GB) G.SKILL RipjawsX F3-12800CL9D-8GBXL 
Hard DriveHard DriveHard DriveCooling
2TB Caviar Green 250GB Hitachi 64GB Crucial M4 Noctua D14 
OSMonitorMonitorMonitor
Linux + Windows 7 64Bits LG Flatron Wide 20.1" 1680x1050 LG Flatron W2442PA 24" 1080p Samsung B2430HD 24 With TV Tuner 1080p 
KeyboardPowerCaseMouse
CM Quickfire Rapid Blue Corsair TX750V2 CM 690 II Logitech G5 
Mouse PadAudio
Steelseries QCK Cloth medium Logitech x-540 
  hide details  
Reply
post #7 of 256
Thread Starter 
Okay so guys, here is the very first programming challenge of this thread. Remember that there is no restriction as to which language you have to use (even though I do expect that most of you will be using C++, Java or Python).

I'm going to start of with something really simple (depending on your programming skill of course), since I'm not really sure how well you're going to perform. The difficulty levels of future challenges will be based on your response in this challenge.

Here's what you have to do:

Write code which just displays a pattern similar to the one below:

*
**
***
****
*****
****
***
**
*


You'll have to make it customisable so that it is possible to change the number of maximum *'s that appear. For example, in the pattern shown above, the maximum number of *'s is 5. The pattern increases the number of stars in every row until it reaches the maximum number and then decreases the number of stars (asterisks). You can either allow it to add input from the user, or you can add input from an object. The only requirement is that you must be able to change the size of the pattern (number of *'s) without re-doing or adding anything significant to the code.

Hoping that at least the 16 people who voted actually make an effort to work on this.

~{Unregistered}
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
post #8 of 256
You should post the challenge in a spoiler box in the first post, so we can easily go back to see it without going to far in the topic.

How do we submit the code?
I did a little something with c++ on codepad.org.
I'm at school and I don't have access to anything better (but still, console c++ is quite basic).
I also can't put a user input because it doesn't support it.
    
CPUMotherboardGraphicsRAM
AMD FX-8320 3.5Ghz @ 3.5ghz Gigabyte 990FXA-UD3 Gigabyte 6850 OC windforce 1GB GDDR5  8GB (2x4GB) G.SKILL RipjawsX F3-12800CL9D-8GBXL 
Hard DriveHard DriveHard DriveCooling
2TB Caviar Green 250GB Hitachi 64GB Crucial M4 Noctua D14 
OSMonitorMonitorMonitor
Linux + Windows 7 64Bits LG Flatron Wide 20.1" 1680x1050 LG Flatron W2442PA 24" 1080p Samsung B2430HD 24 With TV Tuner 1080p 
KeyboardPowerCaseMouse
CM Quickfire Rapid Blue Corsair TX750V2 CM 690 II Logitech G5 
Mouse PadAudio
Steelseries QCK Cloth medium Logitech x-540 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
AMD FX-8320 3.5Ghz @ 3.5ghz Gigabyte 990FXA-UD3 Gigabyte 6850 OC windforce 1GB GDDR5  8GB (2x4GB) G.SKILL RipjawsX F3-12800CL9D-8GBXL 
Hard DriveHard DriveHard DriveCooling
2TB Caviar Green 250GB Hitachi 64GB Crucial M4 Noctua D14 
OSMonitorMonitorMonitor
Linux + Windows 7 64Bits LG Flatron Wide 20.1" 1680x1050 LG Flatron W2442PA 24" 1080p Samsung B2430HD 24 With TV Tuner 1080p 
KeyboardPowerCaseMouse
CM Quickfire Rapid Blue Corsair TX750V2 CM 690 II Logitech G5 
Mouse PadAudio
Steelseries QCK Cloth medium Logitech x-540 
  hide details  
Reply
post #9 of 256
FreeBASIC?
CHILZ - Lan Rig
(17 items)
 
CANARY - Main Rig
(16 items)
 
CADILLAC - HTPC
(14 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon X3480 Asus Maximus III Gene AMD 7950 Mushkin Redline 2133 MHz CL9 
Hard DriveHard DriveHard DriveCooling
250 GB Samsung 840 120 GB OCZ Solid 3 60 GB OCZ Vertex 2 Custom Loop 
OSMonitorKeyboardPower
Windows 8 Pro BenQ GL2450 Filco MajesTouch2 Ninja PC P&C Silencer Mk III 600 W 
CaseMouseMouse PadAudio
Spotswood Small Tech Station Tt e-Sports Saphira Monoprice XXL Yamaha R-S300 + JVC Bookshelfs 
Other
Scythe Kama-Panel 3 
CPUMotherboardGraphicsRAM
FX-8150 @ 4.6 GHz Fatal1ty 990FX Pro 9800 GTX+ 512 MB G.Skill Ripjaws X 1866 CL9 
Hard DriveHard DriveCoolingOS
120 GB OCZ Vertex 3 1 TB WD Black 5x 120mm + MCP350 + EK Supreme HF + MicroRes Windows 8 Consumer Preview 
MonitorKeyboardPowerCase
2x Dell U2212HM Logitech G110 Cooler Master 850W Silent Pro Cooler Master 690 II Adv. 
MouseMouse PadAudio
Razer Death Adder 3.5G Staples Gel Cushion Asus Xonar DG + Senn. PC333D 
CPUMotherboardGraphicsRAM
Q6600 Acer X1800 ATI 5670 2 GB Kingston 
Hard DriveOptical DriveOSMonitor
2 TB WD Green Asus BD-R Windows 7 Home Premium Sony 50" LCD 
KeyboardPowerCaseMouse
Acer Media 220 W SFF Acer X1800 Acer Optical 
Mouse PadAudio
The TV cabinet Denon 2808 7.1 AVR + Dahlquist 350W 8" Sub + Kl... 
  hide details  
Reply
CHILZ - Lan Rig
(17 items)
 
CANARY - Main Rig
(16 items)
 
CADILLAC - HTPC
(14 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon X3480 Asus Maximus III Gene AMD 7950 Mushkin Redline 2133 MHz CL9 
Hard DriveHard DriveHard DriveCooling
250 GB Samsung 840 120 GB OCZ Solid 3 60 GB OCZ Vertex 2 Custom Loop 
OSMonitorKeyboardPower
Windows 8 Pro BenQ GL2450 Filco MajesTouch2 Ninja PC P&C Silencer Mk III 600 W 
CaseMouseMouse PadAudio
Spotswood Small Tech Station Tt e-Sports Saphira Monoprice XXL Yamaha R-S300 + JVC Bookshelfs 
Other
Scythe Kama-Panel 3 
CPUMotherboardGraphicsRAM
FX-8150 @ 4.6 GHz Fatal1ty 990FX Pro 9800 GTX+ 512 MB G.Skill Ripjaws X 1866 CL9 
Hard DriveHard DriveCoolingOS
120 GB OCZ Vertex 3 1 TB WD Black 5x 120mm + MCP350 + EK Supreme HF + MicroRes Windows 8 Consumer Preview 
MonitorKeyboardPowerCase
2x Dell U2212HM Logitech G110 Cooler Master 850W Silent Pro Cooler Master 690 II Adv. 
MouseMouse PadAudio
Razer Death Adder 3.5G Staples Gel Cushion Asus Xonar DG + Senn. PC333D 
CPUMotherboardGraphicsRAM
Q6600 Acer X1800 ATI 5670 2 GB Kingston 
Hard DriveOptical DriveOSMonitor
2 TB WD Green Asus BD-R Windows 7 Home Premium Sony 50" LCD 
KeyboardPowerCaseMouse
Acer Media 220 W SFF Acer X1800 Acer Optical 
Mouse PadAudio
The TV cabinet Denon 2808 7.1 AVR + Dahlquist 350W 8" Sub + Kl... 
  hide details  
Reply
post #10 of 256
Thread Starter 
Quote:
Originally Posted by spikexp View Post

You should post the challenge in a spoiler box in the first post, so we can easily go back to see it without going to far in the topic.
How do we submit the code?
I did a little something with c++ on codepad.org.
I'm at school and I don't have access to anything better (but still, console c++ is quite basic).
I also can't put a user input because it doesn't support it.

Will do.

As for the code, codepad.org is fine. Instead of adding user input, you can just make it so that changing the value of a particular variable can allow you to change the number of stars printed. Input is the easy part; the actual important part of the program is that which actually executes your planned algorithm. If you can do that, then it's absolutely fine.
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
MacBook Pro 13"
(6 items)
 
 
Desktop
(13 items)
 
CPUGraphicsRAMHard Drive
Intel i5 3210 @ 2.5 GHz Intel HD4000 4 GB DDR3 @ 1600 MHz 500 GB @ 5400 RPM 
OSMonitor
OSX Mountain Lion 13.3" @ 1280 x 800 
CPUGraphicsRAMHard Drive
Intel i5 480m@2.67GHz AMD Radeon Mobility 5650 4GB DDR3 500GB 
OSMonitor
Windows 7 64bit HP 15.6" 1366x768 
CPUMotherboardGraphicsRAM
E7500 Intel...:( MSI GTS250 1GB 2GB 
Hard DriveOSMonitorPower
250GB Windows XP 17" LG CRT 1280x768@85hz 400W 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › The Programming Challenge Master Thread