Coder Profile - Show off your skills, get a coder profile.  
 
 
 
Overview  
User Name Cinjection
Real Name Oleksi Derkatch
Location Canada
Ontario
Occupation Student/Software Developer
Gender Male
Age 18 Years Old
WebSite - - -
Post A Profile Comment
Content Distribution
  
Articles
8 Articles

 
Source Codes
35 Source Codes

 
Code Pin Board
11 Pinned Codes

 
Portfolio
3 Entries

 
Friends
75 Friends

 
Custom Emoticons
1 Emoticons

 
Profile Comments
94 Comments

 
Discussion Forum
50 Topics

 
Announcements
1 Announcements

 
Referrals
1 Referrals

 
Recently Added Friends
  view more
Xenocide
Peter Yu
alexxe
Alex Tan
xLink
Dan
Recent Forum Topics
  view more
Silly Errors
Programming :: General Programming
Hey guys.

I love programming with all my heart, but sometimes it makes me want to kill things. I'm going to show you a little exert from a program I'm writing (a real-time pet that you can interact with. Think: tamagachi). This is from the tic-tac-toe game. Tell me if you see the error. I found it.





After about an hour.
Code DownloadOpen In New Window
  1. void TTTGame::setWinner()
  2. {
  3.           int checkSum(0);
  4.  
  5.           //Check the two diagonals
  6.           checkSum = grid[2][0] + grid[1][1] + grid[0][2]; // Check /
  7.           winner = analyseSum(checkSum);
  8.           if ( isGameOver() ) return; //Exit early check
  9.  
  10.           checkSum = grid[0][0] + grid[1][1] + grid[2][2]; // Check \
  11.           winner = analyseSum(checkSum);
  12.           if ( isGameOver() ) return; //Exit early check
  13.  
  14. //-------All other checks
  15. }
Now, all the checks work, including the / diagonal, except for the \ diagonal. Can someone spot the error that made me almost kill a something? The other methods are fine so I'm not showing them to you and I assume you can figure out what this code does.

Give up?
Code DownloadOpen In New Window
  1.  
  2. checkSum = grid[0][0] + grid[1][1] + grid[2][2]; // Check \
  3. winner = analyseSum(checkSum);
the '\' character I have at the end of my comment works as a token to carry the next line over to the current line. That is, the C++ compiler sees this:
Code DownloadOpen In New Window
  1. checkSum = grid[0][0] + grid[1][1] + grid[2][2]; //Check winner=analyseSum(checkSum);
FUCK!!!!!

Anyway. Do you guys have any errors like this that make you want to kill things?

Sorry about the rant. It felt good! :P
View Topic (9 Replies)
Fun little graphics request.
Computing :: Graphics
Hey guys,

I'm planning on making a little game in C++ and I need some graphics help. It's not really a game, as much as a virtual pet that you can interact with. What I need is the images for these pets. Simple 2D images are fine. It'd be ideal, if you could make several "evolved" versions of these pets, so that I can incorporate that system into the game. That way, your pet could transform into a different animal (think pokemon).

Just two or three types with a couple evolutions would be fine. I'd appreciate all the help I can get. 100x100 jpegs will be fine.


Thanks in advance for anyone willing to do some drawing.
View Topic (12 Replies)
Party Time!
Miscellaneous :: Off Topic Discussion
I just got my letter of acceptance from my university of choice. I'm so happy right now! WOOO WOO WOOO WOOO WOOO WOOO WOOO WOOO!
View Topic (15 Replies)
Profile Comments
  view more
Please login to post comments.
 
otoom     Posted 3 Days Ago
 
I don't know whether Ruby does it for me.
I am still deciding which to use.
Perl or Ruby.

Ruby is nice. But i know more Perl than Ruby.
Hmmm.

Idunno.

Ant
 
otoom     Posted 4 Days Ago
 
Yeah mate,
I started a little. It is actually easier than it looks.

Ant...
 
cwbolton     Posted 4 Days Ago
 
oh lol

wel try and get on more for me mate :)
Page  of 32  :: Next Page  >>
 
 
Part of the MyPingle Network
Make A Donation :: Our Affiliates :: Affiliation Request :: Contact Me
Development Blog :: Terms & Conditions :: Privacy Policy :: Documents
Version 1.40.01
Copyright � 2007 - 2008, Scott Thompson, All Rights Reserved