Go to Post ...the hardest part of engineering is communication. - EricVanWyk [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-03-2004, 17:00
meatmanek meatmanek is offline
Programmer/physicist/mathematician
FRC #0868 (TechHounds)
Team Role: Programmer
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Carmel, Indiana
Posts: 142
meatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to beholdmeatmanek is a splendid one to behold
Re: Why I hate c

If you really want to see some obfuscated C code, there's actually a contest for it. http://www.ioccc.org/ - The International Obfuscated C Code Contest.

Winning entries can be found at http://www1.us.ioccc.org/years.html

If you want a language that is very easy to program in and makes sense, check out Ruby at http://www.ruby-lang.org
For example, to run a command 3 times in C, you would do this:

for (int i=3; i<=0; i--) {
command();
}

In Ruby, it would look something like this:

3.times { command }

Ruby is also loosely-typed, meaning you don't have to worry about the size of the variable that's holding your data, the interpreter will determine that for you.

Note that you can't use Ruby on the robot, this is just for hobbyist programmers.
  #2   Spotlight this post!  
Unread 18-03-2004, 18:20
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: Why I hate c

Thanks for that pointer to IOCCC -- I think that's where that bit of code came from, many years ago.

And now I'm reminded of another language, "whitespace,", wherein all code is composed entirely of three characters: space, newline, and tab.

Here's a example bit of code:

Code:
This is a comment. 
   	

   	    		
 
 	
 	   	 	 
	
     	
	    
    	 		
	  	
	  	   	 	

 
 	    		

   	   	 	
 





   		    	 		  	   		  	  
	   
	

   			 			 			  	  		 	  	 			 	   		  	 	
 
 			 
 
	  			 			 			  	  		 	  	 			 	   		  	 	 	 					 		  	 	 		 			  		  	  
	
     	
	   
 
 			 			 			  	  		 	  	 			 	   		  	 	

   			 			 			  	  		 	  	 			 	   		  	 	 	 					 		  	 	 		 			  		  	  
 

 


	

   			  	  		  	 	 		    	 		  	  
 
  
 	
	 			 
    	 	 
	  	
	  			  	  		  	 	 		    	 		  	   	 					 		  	 	 		 			  		  	  
 

   	
	   
 
 			  	  		  	 	 		    	 		  	  

   			  	  		  	 	 		    	 		  	   	 					 		  	 	 		 			  		  	  
 

   	
	       
		 
	

   		 			  		  	 	 			 			 		 		   		 	  	 		 			  		  	 	
   	 	 
   		 	
	
  	
  
	


End of code example.
Maybe next year FIRST will specify whitespace as the language we use.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #3   Spotlight this post!  
Unread 18-03-2004, 19:45
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Why I hate c

Quote:
Originally Posted by gnormhurst
Thanks for that pointer to IOCCC -- I think that's where that bit of code came from, many years ago.

And now I'm reminded of another language, "whitespace,", wherein all code is composed entirely of three characters: space, newline, and tab.

Here's a example bit of code:

...

Maybe next year FIRST will specify whitespace as the language we use.
**** the guy who makes that decission.

By the way, what does your program do?
  #4   Spotlight this post!  
Unread 18-03-2004, 23:37
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Why I hate c

Quote:
Originally Posted by gnormhurst
Thanks for that pointer to IOCCC -- I think that's where that bit of code came from, many years ago.
best bit of IOCCC code ever... only runs on certain machines, though:

Code:
short main[] = {
	277, 04735, -4129, 25, 0, 477, 1019, 0xbef, 0, 12800,
	-113, 21119, 0x52d7, -1006, -7151, 0, 0x4bc, 020004,
	14880, 10541, 2056, 04010, 4548, 3044, -6716, 0x9,
	4407, 6, 5568, 1, -30460, 0, 0x9, 5570, 512, -30419,
	0x7e82, 0760, 6, 0, 4, 02400, 15, 0, 4, 1280, 4, 0,
	4, 0, 0, 0, 0x8, 0, 4, 0, ',', 0, 12, 0, 4, 0, '#',
	0, 020, 0, 4, 0, 30, 0, 026, 0, 0x6176, 120, 25712,
	'p', 072163, 'r', 29303, 29801, 'e'
};
see the hint file here
this is from the first IOCCC competition in 1984
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I Hate It When... sanddrag Chit-Chat 77 25-12-2003 10:57
I hate the BCS and i really ha te KANSAS ST. Jon Reese Chit-Chat 10 11-12-2003 12:09
GRRr.... I hate webpages... XRaVeNX Chit-Chat 4 15-03-2002 12:28
Why I hate Logic EnderofDragon Chit-Chat 2 19-02-2002 21:02


All times are GMT -5. The time now is 15:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi