Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / C and C++ - Which do you prefer?

Author
Message
optical r
22
Years of Service
User Offline
Joined: 23rd Oct 2002
Location: Prime
Posted: 26th Sep 2008 22:19
I ended up buying my own board - PIC16F877A, a couple of years back, since we only vaguely programmed them for a few weeks, due to time-constraints on my soft. eng. course.

I was compelled enough to part with £100 for one. But, I haven't programmed it for ages!


Professional WebDesigns on request! designrjs.com
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 26th Sep 2008 22:21 Edited at: 26th Sep 2008 22:23
Quote: "all I see is a page of meaningless gibberish with the occasional freestanding letter such as "L"."


L is the prefix used for unicode string literals. If you're really that confused, just use functions that have the A suffix (for the win32 api, at least).

e.g. MessageBoxA


09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Sep 2008 22:28
Quote: "I always wanted to code PICs with ASM in Electronics, but as most couldn't write a dice program using a flowchart... well, nobody got higher than a D in Electronics that year."


Quote: "I ended up buying my own board - PIC16F877A, a couple of years back, since we only vaguely programmed them for a few weeks, due to time-constraints on my soft. eng. course."


You guys are making want to take Electronic Engineering classes when I get to college.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 26th Sep 2008 22:36
Quote: "If you're really that confused"


Yes, I am that useless. I tried for three hours to figure out how to put two strings together, putting a lot of strain on Google.. like I said, not cut out for it. Another useless Brit. Oh land of hapless failure...

ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 26th Sep 2008 22:49
A C++ class with inheritance and virtual functions will be slightly slower due to the overhead of the virtual function table and the run time type information, compared to that of a flat member list that a struct provides in C. That's all I'm saying, and that's what I assume the "C++ is slower than C" statements come from. It's really an irrelevant argument though, you're just supposed to program differently in C++ so that the code won't be that 1 to 1.

General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 26th Sep 2008 23:03
Quote: "Yes, I am that useless. I tried for three hours to figure out how to put two strings together, putting a lot of strain on Google.. like I said, not cut out for it. Another useless Brit. Oh land of hapless failure..."
- Lol im british

CPU: AMD X2 6000+ 3.0ghz GFX: NVIDIA BFG Geforce 8800GTS 640MB OC-550mhz core RAM: 2048mb

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Sep 2008 23:06
If you use virtual inheritance, you'll want one function name to carry out different actions depending on the structure passed, right?

So, in C, you'll need to add an item to the structure so you can identify it. Right away, the struct is the same size as a C++ class with its vptr.

Next, in the function being called that you need to act in a virtual way, the obvious method of determining what action to take is to use an if statement or switch statement that uses the identifier you added to the struct to determine what to do.

Which do you think is faster - calling a function that does a conditional check with a jump, or calling a function pointer directly via a vptr? I'll give you a clue - it's not the conditional code.

Sorry, but you're repeating something that has never been true about virtual pointers.

ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 26th Sep 2008 23:33
I'm not talking about emulating object oriented programming in C, I'm talking about normal procedural programming in C versus object oriented programming in C++.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Sep 2008 23:50
You talked about virtual inheritance in a comparison with C - unless you are emulating virtual inheritance in C, why would you use it in an equivalent C++ program?

I mean, yes, if you use loads of stuff in C++ that you don't need, then it will probably run slower than the C equivalent without that stuff, but why would you do that?

ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 27th Sep 2008 01:22
You wouldn't! That's the point I'm trying to make, which is why "C++ is slower than C" doesn't make any sense.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 27th Sep 2008 11:05
Quote: "I still prefer asm for that stuff - seems more satisfying!"


I use that, infact, it was the first programming language ive ever learned and I was born in the 1990s! But im trying (and most of the time failing) to move to C.
mamaji4
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 27th Sep 2008 12:21
I don't code in anything except DBC and the Brainf*ck language
http://www.clifford.at/bfcpu/hanoi.bf
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Sep 2008 12:42
Quote: "Quote: "I still prefer asm for that stuff - seems more satisfying!"

I use that, infact, it was the first programming language ive ever learned"


Lol.

Quote: "I don't code in anything except DBC and the Brainf*ck language"


:o

What was that?

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
mamaji4
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 27th Sep 2008 13:00
Quote: "What was that?"


Developed by Urban Müller, has a 200 byte compiler and consists of 8 commands consisting purely of equivalent C pointer instructions.
It really, really messes up your brain.
If VC++ appears cryptic, and ASM seems "unstructured" you should try this out for a few hours. I came running back.
The hanoi.bf is source in the language, for the classic recursive towers of hanoi problem.
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 27th Sep 2008 13:19 Edited at: 27th Sep 2008 13:22
Quote: "Lol."


Why is that funny? ASM is as much a programming language as C (just because the language is a very close approximation to the instructions the CPU gets, does not mean ASM isn't a language. It's still quite a big step up from sending the CPU raw bin/hex instructions)


09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 27th Sep 2008 15:42
Quote: "http://www.clifford.at/bfcpu/hanoi.bf"


Ah that source seems really simple

mamaji4
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 27th Sep 2008 17:57 Edited at: 27th Sep 2008 18:01
Quote: "Ah that source seems really simple"


Yeah. It's a pity he's messed up such simple code with bad programming style. No indentation and no comments. Even if the code is self-explanatory, how are we supposed to figure out which pointer points to which pointer's pointee?
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 27th Sep 2008 18:10
Yeah, atleast he shold idicate it and add comments

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Sep 2008 19:14
Quote: "Why is that funny? ASM is as much a programming language as C (just because the language is a very close approximation to the instructions the CPU gets, does not mean ASM isn't a language. It's still quite a big step up from sending the CPU raw bin/hex instructions)"


Hmmm.... I looked it up. I'm surprised. I honestly didn't think it would count as mnemonics all have opcode equivalents. The only thing it does is translate them to hex and replace labels with the actual address. :/

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
mamaji4
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 27th Sep 2008 19:16
Added some indentation and comments. Now it should be crystal clear.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //1st line of code
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[-]>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>[-]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[-]>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>[-]>[-]+++++++++++++++++++++++++++.++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++.-------------------.-------
--------------------------------------.+++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++.-----------------------------------------.++++++
++++++++++++++++++.[-]+++++++++++++++++++++++++++.++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++.-------------------------------------
----.+++++++++.---------.+++++.+++++++++++++++++.++++++++++++.++++++++++++++
+++++++++++++.++++++++.------------------.+++++++++++++.+.------------------
-----------------------------------------------------------------.++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.------
---.----------------------------------------------------------------------.+
+++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++.++++++++++
+++.+.------.---------------------------------------------------------------
----------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++.+++++.-------------------------------------------------------------
-----------------.++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++
+++++++++++++++++++++++++.-----------------.++++++++.+++++.--------.--------
----------------------------------------------------.+++++++++++++++++++++++
++++++++++++++++++++++++++++++++++.++++++++.[-]+++++++++++++++++++++++++++.+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.------------
----------------------------.++++++++.----------.++++.+++++++++++++++++++.++
+++++++++++++.+++++++++++++++++++++++++++.---------.+++++++++++..-----------
----.+++++++++.-------------------------------------------------------------
-----------------.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++.+++++++++++++++++++++++.-------------------------------------------
----------------------------------------------.+++++++++++++++++++++++++++++
++++++.+++++++++++++++++++++++++++++++++++++++++.---.---..+++++++++.+++.----
----------.-----------------------------------------------------------------
---.+++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++
++++++++.---.------.--------------------------------------------------------
--------------.++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++
++++++++++++.++++++++++++..----.--------------------------------------------
----------.-----------..++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++...-----------------------------------------------------
--------------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++.+
++++++++.---.---..+++++++++.+++.--------------.-----------------------------
-------------------------.++++++++++++++++++++++++++++++++++++++++++++++++++
+.+++++++++++++++++++.------------------------------------------------------
---------------.+++++++++++++++++++++++++++++++++++++++++++++++++++.++++.---
.+++++++++++++.+++++.-------------------------------------------------------
---------------.+++++++++++++++.[-]>[-]+++++++++>[-]+++>>[-]>[-]<<<<<[->>>>>
+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<[-]>>>[-]>[-]<<<[->>>+<<<]>>>[[-<<
<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>>+<<<]
>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<]>>[[-
<<+>>]<<<[-]+>>>][-]<[->+<]>[[-<+>]<<<[-]+>>>]<<<[>[-]++++++++++++++++++++++
+++++++++++++++++++++++>[-]<<<<<[->>>>>+<<<<<]>>>>>[[-<<<<<+>>>>>]<+++++++++
++++++++++++++++++++++++++++++++++>]<<<[>>>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<<
->>>][-]++++++++++++++++>[-]++++++++++++++>>>>[-]>[-]<<<<<<<<<[->>>>>>>>>+<<
<<<<<<<]>>>>>>>>>[-<+<<<<<<<<+>>>>>>>>>][-]<<[-]+>>>[-]>[-]<<<[->>>+<<<]>>>[
[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<->->[-]>[-]<<<[->>>+
<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<<[->>+<<]>
>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>]<<<[[-]<<<<+++++>>>>]>[-]>[-
]<<<<<<<<<[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>[-<+<<<<<<<<+>>>>>>>>>][-]+<<[-]+>>
>[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<
]<[<<->->[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<
[-]+>>]<]<][-]<<[->>+<<]>>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>]<<<
[[-]<<<++++++++++>>>][-]>[-]<<<<<<<<[->>>>>>>>+<<<<<<<<]>>>>>>>>[-<+<<<<<<<+
>>>>>>>>][-]+++++++++++++++++++++++++<<<[-]>>[>>[-]<[->+<]>[-<+<<<+>>>>]<<-]
[-]<<[->>+<<]>>[-<<+<<+>>>>][-]<<<<<<<<[->>>>>>>>+<<<<<<<<]>>>>>>>>[-<<<<<<<
<+>>>>->>>>][-]<<<<<<<<[->>>>>>>>+<<<<<<<<]>>>>>>>>[-<<<<<<<<+>>>>->>>>]>[-]
>[-]<<<<<<<<<[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>[-<+<<<<<<<<+>>>>>>>>>][-]++<<[-
]+>>>[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+
>>]<]<[<<->->[-]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>
>]<<[-]+>>]<]<][-]<<[->>+<<]>>[[-<<+>>]<<<[-]>>>][-]<[->+<]>[[-<+>]<<<[-]>>>
]<<<[[-]<<<<----->>>>][-]<<<<<<<<<[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>[-<<<<<<<<<
+>>>>>>->>>][-]+++++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++.>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>
>>]>>>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++>[-]<<[>>>[
-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->
>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<
+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<<[-]>>>>>>[-]<[->+<]
>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<<<+>>>>>>>]<<[-<<<<<->>>>>]>]<<<[-]>[-]<
<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>>>>[>>>[-]<<[->>
+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>
>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[
-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>[-]<<[->>+<<]>>[[-<<+>>]<[-]>
]<[[-]<<<<<<<+>>>>>>>]<<<][-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]+
+++++++++>[-]<<[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-
<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->
>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<
[-]>>>>>[-]<[->+<]>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<<+>>>>>>]<<[-<<<<->>>>
]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>>>
>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]
<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<<<]>>>>[
[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>[-]<<[->>+<<]>>
[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<
<<<+>>>>>][-]++++++++++>[-]<<[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>
>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->
[-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]
+>>]<]<]<<<]<[-]>>>>[-]<[->+<]>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<+>>>>>]<<[
-<<<->>>]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<
<<[-]>>>>[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<+>
>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+<<
<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]+>[-]<<[-
>>+<<]>>[[-<<+>>]<[-]>]<[[-]<<<<<<<+>>>>>>>]<<<][-]<[->+<]>>[-]+<[[-<+>]<+++
+++++++++++++++++++++++++++++++++++++++++++++.<+++++++++++++++++++++++++++++
+++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>-<
]>[[-]>[-]<<<<[->>>>+<<<<]>>>>>[-]+<[[-<<<<+>>>>]<<<<+++++++++++++++++++++++
+++++++++++++++++++++++++.<++++++++++++++++++++++++++++++++++++++++++++++++.
>>>>>>-<]>[[-]<<<<<<++++++++++++++++++++++++++++++++++++++++++++++++.>>>>>>]
<<]<<<<<<--------------------------------.>[-]>[-]<<<<<<[->>>>>>+<<<<<<]>>>>
>>[-<+<<<<<+>>>>>>]>>>[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]+++++
+++++>[-]<<[>>>[-]<<[->>+<<]>[-]>[-<<+>+>][-]>[-]<<<<[->>>>+<<<<]>>>>[[-<<<<
+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<[<<<->>->[-]>[-]<<<<[->>>>+
<<<<]>>>>[[-<<<<+>>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<]<<<]<<<[-]
>>>>>>[-]<[->+<]>[[-<+>]>[-]<<<[->>>+<<<]>>>[-<<<+<<<<+>>>>>>>]<<[-<<<<<->>>
>>]>]<<<[-]>[-]<<<<<[->>>>>+<<<<<]>>>>>[-<+<<<<+>>>>>][-]++++++++++<<<<<[-]>
<<[->>>+<<<]>>>[[-<<<+>>>]>[-]<<<[->>>+<<<]>>>[[-<<<+>>>]<<[-]+>>]<]<][-]<[-
>+<]>[[-<+>]<<<[-]+>>>]<<<]<<<<+>>>]<<]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //Last line of code

Had to remove some unnecessary goto's and replaced them with pointers.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Sep 2008 19:25
Quote: "Added some indentation and comments. Now it should be crystal clear.

//1st line of code
<tons of mindf@#k>
//Last line of code"


I'm an ASM masochist, and find that horrid.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 27th Sep 2008 19:56 Edited at: 27th Sep 2008 20:03


Pong game in brainfu*k

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Sep 2008 20:08 Edited at: 27th Sep 2008 20:12
Quote: "Pong game in brainfu*k"


Lol. XD

EDIT:

Even cooler than Brainf*ck:

http://lolcode.com/

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 27th Sep 2008 20:31 Edited at: 27th Sep 2008 20:36
Make a pong in lolcode

//Edit

WOW! Brainf*** interpreter in Lolcode
http://forum.lolcode.com/viewtopic.php?id=51

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Sep 2008 20:35




Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
mamaji4
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 27th Sep 2008 21:03 Edited at: 27th Sep 2008 21:04
Quote: "I'm an ASM masochist, and find that horrid."


Whenever, I do ASM I know I'm being ASadoMasochist.
Sadistic to the guy who has to read my code. Masochistic to myself for having to read my unreadable code two days later.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 27th Sep 2008 23:54
Quote: "The only thing it does is translate them to hex and replace labels with the actual address. :/"

With a hex computer I'm guessing? The assembler looks up the most efficient instruction with compatible operands, and writes binary machine code from it. Hex is just used as a visual representation.

Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Sep 2008 23:57
Quote: "With a hex computer I'm guessing? The assembler looks up the most efficient instruction with compatible operands, and writes binary machine code from it. Hex is just used as a visual representation."


Oops. I'm used to seeing hex opcodes. You're right.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 28th Sep 2008 22:45
I prefer C++ because it's easier to work with.

I'm not a dictator to those that do stuff for me by will. Only those who don't.
mamaji4
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 29th Sep 2008 00:13 Edited at: 29th Sep 2008 00:15
I like the ease of Brainf*ck.
But I'm moving up to Brainf*ck++ which is even easier.
http://www.jitunleashed.com/bf/index.html
GregE
16
Years of Service
User Offline
Joined: 31st Aug 2008
Location:
Posted: 29th Sep 2008 02:54
C++ is best.

Voice Acting Auditions!
In Geek Culture
firebird 112
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location:
Posted: 29th Sep 2008 03:00
C++ is way cool!!!!

from pie in the sky to dark basic fps
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 30th Sep 2008 02:13
Another quick note about C versus C++ and OOP.

Take this code for example (C++):


Yes, I know the code above is pointless, but it's just to make an example.

When you use that code like so (C++):


Calling myVar.add() or myVar.sub() or myVar.someFunction() is like doing this: someFunction(myVar);

Which is the equivalent of what you would have to do in C, which is just as fast (provided you aren't using something like TinyC or some other random C compiler no one has ever heard of).

Cheers,

-naota

I'm not a dictator to those that do stuff for me by will. Only those who don't.
Keo C
17
Years of Service
User Offline
Joined: 3rd Aug 2007
Location: Somewhere between here and there.
Posted: 30th Sep 2008 04:28
C++, It's the only one of the two I decided to learn...


Image made by the overworked Biggadd.

Login to post a reply

Server time is: 2024-11-20 16:28:40
Your offset time is: 2024-11-20 16:28:40