08-05-2014, 03:48 AM
Well, I'm still learning C++ so I can delve into non-Ruby programming for the game engine and editor. Hey, I can't force ntzrmtthihu777 and Kain_Nobel to do all the C++ work. I gotta do some myself. Still, my mind does it in the form of translating ONE language to another. I did it when I went from classic BASIC programming and variants into Ruby/RGSS. Now I'm reading up on C++ and seeing it as the Ruby equivalents.
For example, we have in RUBY, the case...end block. In C++, they call it a switch. But unlike RUBY, you have to add a 'break' command at the end of every decision made, otherwise you'd go to the next action:
vs
Oh, and you have those funky braces {} surrounding blocks of code and semi-colons ending the statements.
For example, we have in RUBY, the case...end block. In C++, they call it a switch. But unlike RUBY, you have to add a 'break' command at the end of every decision made, otherwise you'd go to the next action:
Code:
case my_number
when 1
# Do something
when 2
# Do something else
else
# Do nuthin'
end
vs
Code:
switch(my_number)
{
case 1:
// Do something
break;
case 2:
// Do something else
break;
default:
// Do nuthin'
break;
}
Oh, and you have those funky braces {} surrounding blocks of code and semi-colons ending the statements.