Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming Challenge (Out-of-Date)
New Posts  All Forums:Forum Nav:

Programming Challenge (Out-of-Date) - Page 27  

Poll Results: Are you interested in participating in and/or helping organise and post these programming challenges?

 
  • 100% (2)
    I want to participate.
  • 0% (0)
    I want to contribute by helping posting and organise these challenges.
  • 0% (0)
    I'll only take part if other people are willing to participate.
  • 0% (0)
    I can help and participate - I love programming!
  • 0% (0)
    I do not wish to participate or help.
2 Total Votes  
post #261 of 306
I would love for this thread to get revived. Summers almost here and I'd like to have something to keep my programming skills sharp.
Sulaco
(14 items)
 
 
MacBook Pro
(4 items)
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T Asus Crosshair IV Formula Sapphire 7950 3GB 2x2GB Mushkin Enhanced Blackline  
Hard DriveOSMonitorPower
2x150GB Velociraptor RAID 0 | 2x1TB Hitachi Windows 8 Asus VH242H OCZ ModXStream 700W 
Case
Cooler Master HAF 932 
CPUGraphicsOSMonitor
Core 2 Duo P8400 GeForce 9400M OSX Yosemite 13.3" LED-backlit 
  hide details  
Sulaco
(14 items)
 
 
MacBook Pro
(4 items)
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T Asus Crosshair IV Formula Sapphire 7950 3GB 2x2GB Mushkin Enhanced Blackline  
Hard DriveOSMonitorPower
2x150GB Velociraptor RAID 0 | 2x1TB Hitachi Windows 8 Asus VH242H OCZ ModXStream 700W 
Case
Cooler Master HAF 932 
CPUGraphicsOSMonitor
Core 2 Duo P8400 GeForce 9400M OSX Yosemite 13.3" LED-backlit 
  hide details  
post #262 of 306
I didn't do the last few, was busy lining up this years work. But I'm back now.

-- Will
water damage
(7 items)
 
  
CPUMotherboardGraphicsRAM
2600k 4.5Ghz Asus p8p67 deluxe evga gtx980ti classified SLI 16G ddr3 1600 
Hard DriveOSMonitor
Samsung 850pro x2 Windows 7 Seiki sm40unp 
  hide details  
water damage
(7 items)
 
  
CPUMotherboardGraphicsRAM
2600k 4.5Ghz Asus p8p67 deluxe evga gtx980ti classified SLI 16G ddr3 1600 
Hard DriveOSMonitor
Samsung 850pro x2 Windows 7 Seiki sm40unp 
  hide details  
post #263 of 306
Here we go new challenge sorry forgot to post yesterday here it is

Quote:
Professor Smith is a long-time MICS attendee, but she especially likes it when the College of St. Scholasitca (CSS) hosts. Therefore, she want you to write a program to generate the initials 'CSS' using asterisks ('*') to form block letters.

INPUT SPECIFICATION: You will be given a set of input cases, each of which will begin with an odd decimal integer between 5 and 31 (specifying the height and width of each block letter) followed by <EOLN>. The last input case will be followed by “0<EOLN>â€.

OUTPUT SPECIFICATION: The output cases should appear in the same order as the input cases. Each output case will be of the form “Case c: CSS of dimensions h and w.†(where c is the number of the input case, h is the height, and w is the width) followed by <EOLN>. The 'CSS' initials in block letters with one space between each letter. The initials are followed by a blank line before the next case.

SAMPLE INPUT:
5<EOLN>
11<EOLN>
0<EOLN>
<EOF>

SAMPLE OUTPUT:
Code:
Case•1:•CSS•of•dimensions•5•and•5.<EOLN>
***** ***** *****<EOLN>
*     *     *    <EOLN>
*     ***** *****<EOLN>
*         *     *<EOLN>
***** ***** *****<EOLN>
<EOLN>
Code:
Case•2:•CSS•of•dimensions•11•and•11.<EOLN>
*********** *********** ***********<EOLN>
*           *           *          <EOLN>
*           *           *          <EOLN>
*           *           *          <EOLN>
*           *           *          <EOLN>
*           *********** ***********<EOLN>
*                     *           *<EOLN>
*                     *           *<EOLN>
*                     *           *<EOLN>
*                     *           *<EOLN>
*********** *********** ***********<EOLN>
<EOLN>
<EOF>
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
post #264 of 306
I did it in Javascript so my take is a little different, but here it is:

Copy paste it in an HTML file and throw it in your browser. It should work.

Quote:
<html>
<head>
<script type="text/javascript">
var y = 0;
function displayCss()
{
var x = 0;
var header = "";
var input = document.getElementById("input");
if(parseInt(input.value)){
x = parseInt(input.value);
if((x >= 5) && (x <= 31) && (x%2 == 1)){
y++;
header = "Case•" + y + ":•CSS•of•dimensions•" + x + "•and•" + x + ".<br />";


var letter = new Array();
letter["c"] = new Array();
letter["s"] = new Array();
var i = 0;
var j = 0;
var topmidbot = "";
var output;
var prefix;
var suffix;

while(i < x){
topmidbot += "*";
i++;
}

letter["c"][0] = topmidbot;
letter["c"][x-1] = topmidbot;
letter["s"][0] = topmidbot;
letter["s"][Math.floor(x/2)] = topmidbot;
letter["s"][x-1] = topmidbot;


i=0;
while (i < x){
if((i != 0) && (i != x-1)){
letter["c"][i] = "*";
j = 0;
while(j < x-1){
letter["c"][i] += "&nbsp";
j++;
}

if(i != Math.floor(x/2)){
if(i < Math.floor(x/2)){
j=0;
letter["s"][i] = "*";
while(j < x-1){
letter["s"][i] += "&nbsp";
j++;
}
}
else if (i > Math.floor(x/2)){
j=0;
letter["s"][i] = "&nbsp&nbsp";
while(j < x-2){
letter["s"][i] += "&nbsp&nbsp";
j++;
}
letter["s"][i] += "*";
}
}
}
i++;
}

prefix = "<table border='0'>";
suffix = "</table>";
output ='';
i=0;
while (i < x){
output += "<tr><td>" + letter["c"][i] + "</td> <td>" + letter["s"][i] + "</td> <td>" + letter["s"][i] + "</td> </tr>";
i++;
}
document.getElementById("css").innerHTML = header + prefix + output + suffix;
}
}
}
</script>
</head>
<body>

<h2>Input an odd number between 5 and 31</h2>
<form>
Value: <input type="text" name="input" id="input" />
</form>
<button type="button" onclick="displayCss()">Display CSS</button>
<p id="css"></p>

</body>
</html>
post #265 of 306
That is pretty awesome. Just need to find time to do it but I will get one in.
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
post #266 of 306
Next challenge?
Turbulence
(19 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5-2500k 4.4GHz Asus P8P67 Pro 3.1 HIS HD 7870 2GB G.SKILL Ripjaws X 16GB 1600MHz 
Hard DriveHard DriveOptical DriveCooling
Crucial m4 128GB Samsung Spinpoint F3 1TB Asus DRW-24B1ST Noctua NH-D14 
CoolingOSMonitorKeyboard
Accelero Twin Turbo II Windows 7 Professional N Dell U2311H Realforce 87U White 55cN 
PowerCaseMouseMouse Pad
Corsair TX650V2 Fractal Design R3 Black Pearl Razer DeathAdder SteelSeries 4HD 
AudioAudioAudio
Audinst HUD-mx1 Beyerdynamic DT990 Premium 600 Ω Recabled M-Audio AV40 
  hide details  
Turbulence
(19 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5-2500k 4.4GHz Asus P8P67 Pro 3.1 HIS HD 7870 2GB G.SKILL Ripjaws X 16GB 1600MHz 
Hard DriveHard DriveOptical DriveCooling
Crucial m4 128GB Samsung Spinpoint F3 1TB Asus DRW-24B1ST Noctua NH-D14 
CoolingOSMonitorKeyboard
Accelero Twin Turbo II Windows 7 Professional N Dell U2311H Realforce 87U White 55cN 
PowerCaseMouseMouse Pad
Corsair TX650V2 Fractal Design R3 Black Pearl Razer DeathAdder SteelSeries 4HD 
AudioAudioAudio
Audinst HUD-mx1 Beyerdynamic DT990 Premium 600 Ω Recabled M-Audio AV40 
  hide details  
post #267 of 306
I'm pitching in
since i just learnt Algorithms techniques, why dont i ask you guys to write me implementation of shortest path using
1.DFS BFS (uniformed search)
2.Hill Climbing, Djikstra, and A*(informed search)
list all the cost path, path traveled, heuristic cost, time taken to finish calculation.


restriction
1. use OO or Recursive only
2. there are no sets of questions, you make it up yourself, but it have to be CYCLIC GRAPH. you can't use Binary tree, Acyclic graph, or any other iteration. example for simple question is a shortest path on map

feel free to use advanced technique as multithreading (especially when traversing), parallel programming.
also list your Level of complexity. whether it's for beginner, intermediate or advanced.
dont show complex codes(intermediate and advanced) here...put in GIT,SVN, or Mercurial somewhere.

example of my codes (Intermediate,done in 2 weeks, 1 week to wrap my head around on how to represent the nodes, 1 week to code, using OOP and VS2010.)
https://bitbucket.org/lunan/a.i-1
Outdated
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8200 2.6 Ghz Asrock g31M-S R2 ATi 3870 2GB Kingston Value RAM 
Hard DriveOptical DriveOSMonitor
2TB WD Green+ 640GB WD Blue None Win 7 Ultimate 21.5 Dell 
KeyboardPowerCaseMouse
HP Wireless Keyboard 550W Cooler Master None Logitech cheap mouse 
Mouse Pad
none 
  hide details  
Outdated
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8200 2.6 Ghz Asrock g31M-S R2 ATi 3870 2GB Kingston Value RAM 
Hard DriveOptical DriveOSMonitor
2TB WD Green+ 640GB WD Blue None Win 7 Ultimate 21.5 Dell 
KeyboardPowerCaseMouse
HP Wireless Keyboard 550W Cooler Master None Logitech cheap mouse 
Mouse Pad
none 
  hide details  
post #268 of 306
Huzzah, summer is pretty much here, and on vacation, bring them challanges!
Back in Black
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 BE (C3) Biostar TA790GX A3+ Sapphire HD 5770 (v2) CORSAIR XMS3 4GB DDR3 
Hard DriveOptical DriveOSMonitor
WD Caviar Black 640GB Sony Optiarc CD/DVD RW Windows 7 Ultimate x64 NEC MultiSync LCD 1960NXi 
KeyboardPowerCaseMouse
Microsoft Comfort Curve Keyboard 2000 Corsair 650TX Cooler Master Storm Scout Logitech MX 400 Laser 
  hide details  
Back in Black
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 BE (C3) Biostar TA790GX A3+ Sapphire HD 5770 (v2) CORSAIR XMS3 4GB DDR3 
Hard DriveOptical DriveOSMonitor
WD Caviar Black 640GB Sony Optiarc CD/DVD RW Windows 7 Ultimate x64 NEC MultiSync LCD 1960NXi 
KeyboardPowerCaseMouse
Microsoft Comfort Curve Keyboard 2000 Corsair 650TX Cooler Master Storm Scout Logitech MX 400 Laser 
  hide details  
post #269 of 306
Quote:
Originally Posted by Chris++ View Post
Huzzah, summer is pretty much here, and on vacation, bring them challanges!
Fun ones though... *cough not like lunan1t4's cough*.
post #270 of 306
I really need to write myself a reminder for this I have been so nuts with work etc lately I totally space on it till someone posts something and I get the reminder email. Fun ones you say hmmm I don't think I have posted this one yet.

Quote:
Problem 2 — Sum of Digits Squared

Professor Smith loves number games. One game she likes is finding the sum of the squares of all the digits of a number. If you do this repeatedly, you will ultimately get to either one or four. For example, 16 becomes 37 (12 + 62) which becomes 58 (32+72) which becomes 89 (52+82), becoming 145, 42, 20, and 4, in succession.

Given a positive number, you are to print the sequence of digit square sums starting with that number and ending with 1 or 4. (If the number is either 1 or 4, you should apply the pattern at least once.)

INPUT SPECIFICATION: You will be given a set of input cases, each of which will be an unsigned decimal integer less than 10000000. The last input case will be followed by -1. There may be any number of spaces and <EOLN>'s before, after, and between the input cases and the terminating -1.

OUTPUT SPECIFICATION: The output cases should appear in the same order as the input cases. Each output case will be of the form “Case c†(where c is the number of the input case) followed by <EOLN> followed by the sequence of digit square sums beginning with the input case and ending with 1 or 4. Each number is followed by <EOLN> and an extra <EOLN> follows the output case.

SAMPLE INPUT:
1<EOLN>
4194304<EOLN>
-1<EOLN>
<EOF>

SAMPLE OUTPUT:
Case•1<EOLN>
1<EOLN>
1<EOLN>
<EOLN>
Case•2<EOLN>
4194304<EOLN>
139<EOLN>
91<EOLN>
82<EOLN>
68<EOLN>
100<EOLN>
1<EOLN>
<EOLN>
<EOF>
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
This thread is locked  
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming Challenge (Out-of-Date)