Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming Challenge #9 - writing a basic game
New Posts  All Forums:Forum Nav:

Programming Challenge #9 - writing a basic game - Page 3

post #21 of 34
Quote:
Originally Posted by JoeChamberlain View Post

Well it's taken me a while, and I've made it so the player gets a bit more luck that usual.
Source code, written in Java (Click to show)
Code:
public class BlackJack()
{
        public static void main(String[] args)
        {
                System.out.println("You win!");
        }
}

Yes, I'm also really impressed with Tom's effort. And.. I can't believe how similar C# is to Java (not Tom's, a few posts ago), first time I've seen it properly.

Well that is efficient wink.gif.
Petrichor
(24 items)
 
Placid
(12 items)
 
Poised
(6 items)
 
CPUMotherboardGraphicsRAM
Intel i5-3570K @ 4.7GHz / 1.28V ASRock Z77 Extreme4 Gainward GTX 1060, 6GB TeamGroup, 8GB, DDR3-1600MHz / 1.5V, 9-9-9-24 1T 
Hard DriveHard DriveHard DriveOptical Drive
Samsung SSD 830 Series, 128GB Seagate Barracuda ST31000524AS, 1TB, 7200RPM Hitachi Deskstar IDK 0S03661, 3TB, 7200RPM LG GH22NS50 
CoolingCoolingCoolingOS
Lamptron FC5 V3 Noctua NH-D15 Noctua NF-A14 FLX (140mm) (x5)  Windows 10 Pro (64-bit) 
MonitorMonitorKeyboardPower
Dell UltraSharp U2312HM (x3) LG 40UB800V Lioncast LK20, TKL, Cherry MX-Blue, DE-Layout EVGA SuperNOVA G3 750 750W 
CaseMouseMouse PadAudio
Fractal Define R4 Black Mionix Castor Akasa Venom XXL Denon PMA 520 AE AMP 
AudioAudioAudioAudio
Dali Zensor 3 Speakers (x2) Magnat Monitor Supreme Sub 301 A Audioengine D1 DAC / Headphone AMP Beyerdynamic DT 770 Pro 250 Ω 
CPUMotherboardRAMHard Drive
Intel Pentium G3440T ASRock E3C226D2I Kingston ValueRAM, 16GB, DDR3-1333MHz, ECC HGST IDK Deskstar H3IK40003272SE, 4TB, 7200RPM 
Hard DriveOSPowerCase
Seagate ST4000DM000, 4TB, 5900RPM (x3) FreeNAS be quiet! Straight Power E9 400W NZXT Source 210 Elite 
CPUGraphicsRAMHard Drive
Intel Core i3-2367M Intel HD Graphics 3000 4GB 500GB 
OSMonitor
Windows 10 Enterprise (64-bit) 11.6" WXGA non-glare LED TFT, 1366x768 
  hide details  
Reply
Petrichor
(24 items)
 
Placid
(12 items)
 
Poised
(6 items)
 
CPUMotherboardGraphicsRAM
Intel i5-3570K @ 4.7GHz / 1.28V ASRock Z77 Extreme4 Gainward GTX 1060, 6GB TeamGroup, 8GB, DDR3-1600MHz / 1.5V, 9-9-9-24 1T 
Hard DriveHard DriveHard DriveOptical Drive
Samsung SSD 830 Series, 128GB Seagate Barracuda ST31000524AS, 1TB, 7200RPM Hitachi Deskstar IDK 0S03661, 3TB, 7200RPM LG GH22NS50 
CoolingCoolingCoolingOS
Lamptron FC5 V3 Noctua NH-D15 Noctua NF-A14 FLX (140mm) (x5)  Windows 10 Pro (64-bit) 
MonitorMonitorKeyboardPower
Dell UltraSharp U2312HM (x3) LG 40UB800V Lioncast LK20, TKL, Cherry MX-Blue, DE-Layout EVGA SuperNOVA G3 750 750W 
CaseMouseMouse PadAudio
Fractal Define R4 Black Mionix Castor Akasa Venom XXL Denon PMA 520 AE AMP 
AudioAudioAudioAudio
Dali Zensor 3 Speakers (x2) Magnat Monitor Supreme Sub 301 A Audioengine D1 DAC / Headphone AMP Beyerdynamic DT 770 Pro 250 Ω 
CPUMotherboardRAMHard Drive
Intel Pentium G3440T ASRock E3C226D2I Kingston ValueRAM, 16GB, DDR3-1333MHz, ECC HGST IDK Deskstar H3IK40003272SE, 4TB, 7200RPM 
Hard DriveOSPowerCase
Seagate ST4000DM000, 4TB, 5900RPM (x3) FreeNAS be quiet! Straight Power E9 400W NZXT Source 210 Elite 
CPUGraphicsRAMHard Drive
Intel Core i3-2367M Intel HD Graphics 3000 4GB 500GB 
OSMonitor
Windows 10 Enterprise (64-bit) 11.6" WXGA non-glare LED TFT, 1366x768 
  hide details  
Reply
post #22 of 34
Quote:
Originally Posted by Nestala View Post

Well that is efficient wink.gif.

It's efficient, but it's wrong. Cause everyone knows the house always wins. Here, let me fix that for you:
Fixed Code (Click to show)
Code:
public class BlackJack()
{
        public static void main(String[] args)
        {
                System.out.println("You Lose!");
                NutKick();
        }
}
Death Star
(21 items)
 
Darksaber
(11 items)
 
 
CPUMotherboardGraphicsRAM
Athlon II x2 245 Asus M3A78 Radeon HD6570 1GB Mushkin Silverline 2GB DDR2  
Hard DriveOptical DriveOSMonitor
OCZ Vertex 2 120GB Samsung Blu-Ray Windows 7 Samsung 46" DLP 
PowerCaseOther
Silverstone Strider Essentials 400W Silverstone Milo ML03B Hauppage WinTV 1250 
  hide details  
Reply
Death Star
(21 items)
 
Darksaber
(11 items)
 
 
CPUMotherboardGraphicsRAM
Athlon II x2 245 Asus M3A78 Radeon HD6570 1GB Mushkin Silverline 2GB DDR2  
Hard DriveOptical DriveOSMonitor
OCZ Vertex 2 120GB Samsung Blu-Ray Windows 7 Samsung 46" DLP 
PowerCaseOther
Silverstone Strider Essentials 400W Silverstone Milo ML03B Hauppage WinTV 1250 
  hide details  
Reply
post #23 of 34
Huh... so... I decided I wanted to try learning more about Win 8 apps and databindings...

Code attached (VS 2012 project).

It may abuse databinding a bit much... but it worked out pretty well. I could clean up the code a bit probably.\

EDIT: Oh, I should note, for some reason the databinding to the list that shows the cards seems to occasionally glitch and show a card duplicated. I'm unsure what causes this. I've debugged it and the hand is correct (and score as well), but it will show the same card twice anyway on the UI.

Blackjack.zip 388k .zip file


Edited by Xeio - 6/30/13 at 10:26pm
Micro Dance
(8 items)
 
  
CPUMotherboardGraphicsRAM
i7-4790k z97i-plus EVGA GTX980 SC 16GB Team Xtreme 2400 
Hard DriveCoolingOSCase
512GB Samsung SSD 830 NH-L12 Windows 10 EVGA Hadron Air 
  hide details  
Reply
Micro Dance
(8 items)
 
  
CPUMotherboardGraphicsRAM
i7-4790k z97i-plus EVGA GTX980 SC 16GB Team Xtreme 2400 
Hard DriveCoolingOSCase
512GB Samsung SSD 830 NH-L12 Windows 10 EVGA Hadron Air 
  hide details  
Reply
post #24 of 34
Forgive my ignorance & apologies for being off topic, but this is the most amazing thread I've come across.......I'd rep you guys a thousand times if I could .

To be able to write code like that is my ultimate passion/dream.

I really want to learn how to do that (games with a GUI) using C++ and have downloaded Buckys tutorials, but once I've reached Private & Public strings, he completely lost me.....

How did you guys start to be able to reach this stage ? I'm willing to put in as many hours as it requires so I can kick all your butts in next year's competition lol (or maybe in 3 years).


Cheers for an awesome thread thumb.gif...
Edited by eXXon - 6/30/13 at 10:46pm
TheSadFlute
(16 items)
 
DyingHeart
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K TUF Sabertooth MSI 1080 Ti 16GB 2400MHz C15 
Hard DriveHard DriveHard DriveCooling
Corsair 480GB LE 3TB WD Green Sammy 500GB 850 EVO H100i 
OSMonitorKeyboardPower
Windows 7 Pro  BenQ XR3501 Logitech G710+ EVGA G2 750W 
CaseMouseAudioAudio
Cooler Master Stryker Logitech G602 Asus Strix Nakamichi 5.1 
CPUMotherboardGraphicsRAM
Phenom II X4 965BE  Sapphire 790X Zotac GTX650  4GB Corsair 1066 DDR2 (1GBx4) 
Hard DriveHard DriveCoolingCooling
G.Skill Phoenix Pro 120GB WD 2TB Green Stock 3x120mm UQ fans 
OSMonitorKeyboardPower
W7 Pro SP1 x64 LG 21' 1680x1050 Genius  Corsair CX600 
CaseMouseMouse PadAudio
Gigabyte  E-Blue Mazer XFX WarPad On-board 
Audio
Logitech G35 
  hide details  
Reply
TheSadFlute
(16 items)
 
DyingHeart
(17 items)
 
 
CPUMotherboardGraphicsRAM
i7-6700K TUF Sabertooth MSI 1080 Ti 16GB 2400MHz C15 
Hard DriveHard DriveHard DriveCooling
Corsair 480GB LE 3TB WD Green Sammy 500GB 850 EVO H100i 
OSMonitorKeyboardPower
Windows 7 Pro  BenQ XR3501 Logitech G710+ EVGA G2 750W 
CaseMouseAudioAudio
Cooler Master Stryker Logitech G602 Asus Strix Nakamichi 5.1 
CPUMotherboardGraphicsRAM
Phenom II X4 965BE  Sapphire 790X Zotac GTX650  4GB Corsair 1066 DDR2 (1GBx4) 
Hard DriveHard DriveCoolingCooling
G.Skill Phoenix Pro 120GB WD 2TB Green Stock 3x120mm UQ fans 
OSMonitorKeyboardPower
W7 Pro SP1 x64 LG 21' 1680x1050 Genius  Corsair CX600 
CaseMouseMouse PadAudio
Gigabyte  E-Blue Mazer XFX WarPad On-board 
Audio
Logitech G35 
  hide details  
Reply
post #25 of 34
Thread Starter 
The beauty of this challenge is that you can start out by writing a very basic command line version without any computer opponent and in any language you choose. And as they're just personal challenges, it's only about taking things as hard as you need to to accomplish it yourself.

So take a look at the beginner challenges in the opening post of this thread and work your way up. If / when you get bored of that, follow the links to the previous challenges (they're about once a month, give or take) and have a play with them.

Not all the challenges are composed by me and the different challenges will tend to test different sides to programming.

If you have any difficulties or questions, just ask smile.gif
post #26 of 34
That's it. I'm learning how to program. What to start off with. C++? Alright lets go.
post #27 of 34

maybe I'll find the time to work on this later...

sounds like an interesting challenge

post #28 of 34
Quote:
Originally Posted by hajile View Post

maybe I'll find the time to work on this later...
sounds like an interesting challenge
Nice edit tongue.gif
post #29 of 34
Quote:
Originally Posted by APhamX View Post

That's it. I'm learning how to program. What to start off with. C++? Alright lets go.

Nah, you have to start with x86 Assembly. ( Pretty sure there are enough maniacs here to try and do that <3 )

This is a great thread. If I wasn't so lazy, I'd join the fun
The Dark Knight
(13 items)
 
Rebirth
(13 items)
 
 
CPUMotherboardGraphicsRAM
i5 2500K. 4.5Ghz (Summer Clocks) ASUS P8P67 Pro ( Rev 3.0 ) MSI 6970 Lightning (downclocked) CFX with MSI 6... 8GB G.Skill Sniper 1600Mhz 
Hard DriveOptical DriveOSMonitor
1 TB Spinpoint F3 +2TB F4(backups) Random LG drive Win7 SP1 64bit ASUS VH236H @1080p 
KeyboardPowerCase
Saitek Gaming keyboard ... >_> Corsair TX750 Rosewill Gear x3 
CPUMotherboardGraphicsRAM
C2D P8600 @ 2.4Ghz (undervolted) Crappy dell Studio XPS one 4670M (1GB) I don't remember... 
Hard DriveOptical DriveOSMonitor
Crucial M4 4x Blu-ray ROM Win7 SP1 64bit 15.6" WLED @ 1080p 
KeyboardPower
Old Saitek Gaming Keyboard 90W adapter 
  hide details  
Reply
The Dark Knight
(13 items)
 
Rebirth
(13 items)
 
 
CPUMotherboardGraphicsRAM
i5 2500K. 4.5Ghz (Summer Clocks) ASUS P8P67 Pro ( Rev 3.0 ) MSI 6970 Lightning (downclocked) CFX with MSI 6... 8GB G.Skill Sniper 1600Mhz 
Hard DriveOptical DriveOSMonitor
1 TB Spinpoint F3 +2TB F4(backups) Random LG drive Win7 SP1 64bit ASUS VH236H @1080p 
KeyboardPowerCase
Saitek Gaming keyboard ... >_> Corsair TX750 Rosewill Gear x3 
CPUMotherboardGraphicsRAM
C2D P8600 @ 2.4Ghz (undervolted) Crappy dell Studio XPS one 4670M (1GB) I don't remember... 
Hard DriveOptical DriveOSMonitor
Crucial M4 4x Blu-ray ROM Win7 SP1 64bit 15.6" WLED @ 1080p 
KeyboardPower
Old Saitek Gaming Keyboard 90W adapter 
  hide details  
Reply
post #30 of 34
Thread Starter 
bump

Mods, any chance this can be made sticky alongside #8?
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Programming Challenge #9 - writing a basic game