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 16  

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 #151 of 306
Quote:
Originally Posted by xtascox View Post
How about AI that works for a grid of size n?
Like for a large tictactoe game or a general game that uses a grid? Can't really write a smart AI for a generic game that uses a grid because you'll need to know more about the game, how it's played, etc, so you can write some heuristics functions.
BlackMesa
(14 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II x6 Gigabyte XFX RF460 16gb G.Skill 
Hard DriveHard DriveOSMonitor
OCZ Vertex2 Sata II Coorsair Force GS Sata III Debian (testing) Shimian 27" 
KeyboardMouse
Filco w/ blue cherries Who needs a mouse? 
  hide details  
BlackMesa
(14 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II x6 Gigabyte XFX RF460 16gb G.Skill 
Hard DriveHard DriveOSMonitor
OCZ Vertex2 Sata II Coorsair Force GS Sata III Debian (testing) Shimian 27" 
KeyboardMouse
Filco w/ blue cherries Who needs a mouse? 
  hide details  
post #152 of 306
Quote:
Originally Posted by dangerousHobo View Post
Like for a large tictactoe game or a general game that uses a grid? Can't really write a smart AI for a generic game that uses a grid because you'll need to know more about the game, how it's played, etc, so you can write some heuristics functions.
Square grid of size n x n where the object is to get n boxes in a row while preventing the other player from doing the same.
post #153 of 306
Connect 4 is a bit harder to write an AI for, but still doable in a week even if you're just learning I think. The game has been solved, a perfect player will always win if they go first, but writing a perfect AI isn't a simple task.

A large tic tac toe game would be interesting and there are several other fairly simple games that the challenge could focus on.
Monster v2
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 GA-P35-DS3L HD 4850 6GB Crucial Ballistix 
Hard DriveOSMonitorKeyboard
WD 320GB Windows 7 Ultimate (64bit) 2x Acer 22" WS Logitech g15 
PowerCaseMouse
OCZ 700W Gigabyte 3D aurora Logitech Mx510 
  hide details  
Monster v2
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 GA-P35-DS3L HD 4850 6GB Crucial Ballistix 
Hard DriveOSMonitorKeyboard
WD 320GB Windows 7 Ultimate (64bit) 2x Acer 22" WS Logitech g15 
PowerCaseMouse
OCZ 700W Gigabyte 3D aurora Logitech Mx510 
  hide details  
post #154 of 306
Lol! I love the idea of tictac toe with a grid size of N, but I fear that the time required to play would increase on the order of N squared, with no real change in algorithim/ ability for either party to win ^_^
For sale
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7-920 Asus P6T Deluxe Asus GTX460 TOP 768mb G Skill ECO 1600 CAS7 1.35V 
Hard DriveOptical DriveOSMonitor
2x Vertex 60 GB raid[0] Asus DVDRW W7,Ubuntu 2 xAsus VH236H 
KeyboardPowerCaseMouse Pad
Razer Ultra X3 1000W HAF 932 My Desk 
  hide details  
For sale
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7-920 Asus P6T Deluxe Asus GTX460 TOP 768mb G Skill ECO 1600 CAS7 1.35V 
Hard DriveOptical DriveOSMonitor
2x Vertex 60 GB raid[0] Asus DVDRW W7,Ubuntu 2 xAsus VH236H 
KeyboardPowerCaseMouse Pad
Razer Ultra X3 1000W HAF 932 My Desk 
  hide details  
post #155 of 306
will you accept matlab? it is not like C++ or anything but it is made for physical sciences/engineering/data analysis and can do all of this fine
aeoiu-lys
(13 items)
 
  
CPUMotherboardGraphicsRAM
1090t Thuban @4.0ghz 1.43v nb 1.5v @ 3000 ASUS M4A89TD Unlocked HIS 6950 Ripjaws Series 8GB 2000 @ 1874 9-9-9-24 
Hard DriveOptical DriveOSMonitor
Intel x25m 160gb LG dvd Windows 7 ultimate 64bit Dell 21.5" 1680x1050 
KeyboardPowerCaseMouse
Microsoft 2500 Thermaltake Black Widow 850w Raidmax Aeolus DeathAdder 
  hide details  
aeoiu-lys
(13 items)
 
  
CPUMotherboardGraphicsRAM
1090t Thuban @4.0ghz 1.43v nb 1.5v @ 3000 ASUS M4A89TD Unlocked HIS 6950 Ripjaws Series 8GB 2000 @ 1874 9-9-9-24 
Hard DriveOptical DriveOSMonitor
Intel x25m 160gb LG dvd Windows 7 ultimate 64bit Dell 21.5" 1680x1050 
KeyboardPowerCaseMouse
Microsoft 2500 Thermaltake Black Widow 850w Raidmax Aeolus DeathAdder 
  hide details  
post #156 of 306
Whew. I'm still down to write that tic tac toe server if anyone is interested in pitting their code against someone else's...
post #157 of 306
Sorry I have not posted any challenges school kind of took over my life. I am up for doing more in the tic tac toe thing too. Now that school is over will try and start posting once a week again. I still have stacks of challenges.
    
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 #158 of 306
Quote:
Originally Posted by Midpipps View Post
Sorry I have not posted any challenges school kind of took over my life. I am up for doing more in the tic tac toe thing too. Now that school is over will try and start posting once a week again. I still have stacks of challenges.
Same situation except its work and not school
post #159 of 306
OK here we go I am still not against doing the tic tac toe server but wanted to get this going again now that I have time to post these again. 1 week to finish unless we want to extend it due to holiday season.

On to the challenge
Quote:
Weighing on a Tertiarian Scale

Back in the Hellenic era, there was a small island in the Mediterranean Sea known as Tertiaria. It was close to Sparta, but because of its mountainous terrain the Spartans found it difficult to conquer and it remained an independent state until the great earthquake of 729BC when it sank beneath the sea. It had a remarkable civilization and some modern historians think it is the basis for the mythological city of Atlantis.
Tertiaria is still known for its fundamental contributions to science and mathematics, many of which were adopted by the Greeks and later by the Romans. For example, Tertiarians were the first group to use the standard weight of pounds, which we still use today. Tertiarian mathematics used base 3 for all its calculations. (Historians postulate this was out of respect for King Ternary who lost two fingers on each hand while battling the Spartans.)
Tertiarian trade scales were a standard for many centuries. They were known for their accuracy and ease of use. They were the first to model a scale with weighing pans on each side and a fulcrum in the middle (see picture above). The object to be weighed was placed on the left side of the balance and weights were placed on both sides, until balance was obtained. This sounds strange by modern standards, because typically, on modern scales we would only place weights on the right side. However, the modern method requires additional weights. The Tertiarian method only requires one weight for each power of three pounds, e.g. 1 weight of 1lb, 1 weight of 3lbs, 1 weight of 9lbs, etc.

Say you are weighing a 2 pound Tertiarian hen (known for their succulent white meat). You place the hen on the left side. Place the 3 pound weight on the right side. This is too heavy, so place the 1 pound weight with the hen on the left side to achieve balance. Note that the weights on the right side minus the weights on the left side equals the weight of the object. (3-1 = 2).

As another example, consider weighing a 21lbs Tertiarian squash. Using the Tertiarian system, you would place weights of 27lbs and 3lbs in the right pan and a weight of 9lbs in the left pan (along with the object) again achieving balance. (30 – 9 = 21).

Write a program that accepts as input a series of weights for various objects in base 10 and outputs the weights to be placed in both pans for each case. Remember that you have only one weight of each power of 3lbs.

Input:
The first line contains a positive integer, n, less than or equal to 100, indicating how many instances of the problem are to be solved. On each of the next n lines there is a non-negative integer no greater than one million, giving the weight of an object.

Output:
For each of the n weights, the program should produce a single line of output containing the measuring weights to be placed in each pan, in descending order on each side, as formatted below.
Slight variations in the formatting, such as differences in the number of spaces around the numbers, are acceptable.

Sample Input:
4
2
3
21
250

Corresponding output:
left pan: right pan: 3 1
left pan: 1 right pan: 3
left pan: right pan: 3
left pan: 9 right pan: 27 3
left pan: 3 right pan: 243 9 1

Edited by Midpipps - 1/3/11 at 12:06am
    
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 #160 of 306
I think I will leave this up for another week I have not had time to make my entry yet and not sure if no one else is interested or not but maybe someone else will jump in and have some fun with it too.
    
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)