Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

is this considered good coding

Name: Anonymous 2012-01-01 13:14

the whole file is like this it is a  header file btw

char strSaveLoadReadyLoad[] = "@a004@s016@i@cffd8af Loading the above save data.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadLoading[] = "@a004@s016@i@cffd8afもう一度、このセーブデータを選択すると、すぐに Load されます。";
#else                // 英語
char strSaveLoadLoading[] = "@a004@s016@i@cffd8af If you select it once more, the data will be loaded.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadNoneTitle[] = "@s024@cffdf3f- タイトル無し -";
#else                // 英語
char strSaveLoadNoneTitle[] = "@s024@cffdf3f- No Title.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpInfoChange[] = "ファイル情報の表記を変更します。簡易タイトル、日時が交互に表示されます。";
#else                // 英語
char strSaveLoadHelpInfoChange[] = "Fight information display refreshed. Title and    date will be displayed.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpCall[] = "利用法についての詳細説明を見る事が出来ます。";
#else                // 英語
char strSaveLoadHelpCall[] = "You can view instructions on how to use this.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpCancel[] = "Load ファイルを選択している状態でも Cancel を選ぶと Load されずにゲームに戻ります。"
                        "@nSave 時は OK でも Cancel でも同じ効果です。";
#else                // 英語
char strSaveLoadHelpCancel[] = "Click cancel while selecting a file to load to    return to your current game.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpOk[] = "Load 時にファイルを選択して OK を選ぶと、データが Load されゲームが続きから始まります。"
                        "@nSave 時は、OK でも Cancel でも同じ効果です。";
#else                // 英語
char strSaveLoadHelpOk[] = "Click OK while selecting a file to load, and the  saved game will be loaded. ";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpSaveTitle[] = "ゲーム中にしか使えません。";
#else                // 英語
char strSaveLoadHelpSaveTitle[] = "Only available during game play.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpSaveMode[] = "Save モードに切り替えます。";
#else                // 英語
char strSaveLoadHelpSaveMode[] = "Switch save mode.";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpLoadMode[] = "Load モードに切り替えます。";
#else                // 英語
char strSaveLoadHelpLoadMode[] = "Switch load mode";
#endif

#ifndef _ENGLISH    // 日本語
char strSaveLoadHelpLoad[] = "@s016 Load するファイルを選択しました。Load する時は OK を押すか"
                        "@n@c9fefff同じファイル@cffffffを、@n@c9fefffもう一度選択@cffffffして下さい。@n"
                        " Load しない場合は、Cancel を選択するか ESC で抜けるか、右クリックして下さい。";
#else                // 英語
char strSaveLoadHelpLoad[] = "File selected. Click okay to load, or cancel to   cancel load operation.";
#endif

Name: Anonymous 2012-01-01 15:31

It's like the special olympics, only s/physical/mental/

Name: Anonymous 2012-01-01 15:32

>>40
better than sherlock holmes.

Name: Anonymous 2012-01-01 15:37

>>40
Systems Analyst, Architect, Engineer, Developer and Integrator. Principal strengths in systems engineering and integration as well as software engineering and development.
I enjoy designing, developing, and implementing cost effective reliable solutions that require the integration of systems and software. It's a blast!

That doesn't sound like him, if it really was him it would've said something like:
Systems Analyst, Architect, Engineer, Developer and Integrator. Why are you reading this you mental midget, could you only get a job with hiring others, fit for someone like you, now go scrub another toilet.

Name: Anonymous 2012-01-01 15:43

>>40
Now that I think about it he's probably hired by Nikon or Canon to tarnish the reputation of Kodak.

Name: Anonymous 2012-01-01 15:50

>>44
Software Engineer Nikon Metrology

http://www.linkedin.com/in/karthickgopikrishnan

Software Developer TechWizard
Sounds like the type of place he would work at.

Name: Anonymous 2012-01-01 17:33

>>21
Great, now tell me what character encoding you're getting and how you're going to interface with your output system.

Name: Anonymous 2012-01-01 19:22

[code]enum StringList {
     SaveLoadReadyLoad,
     SaveLoadLoading,
     SaveLoadNoneTitle
     /* ... */
}

I would make an enum like this, and use these as indices into the string table.

#define stringize(...) _stringize(__VA_ARGS__)
#define _stringize(...) #__VA_ARGS__
#define concat(x,...) _concat(x,__VA_ARGS__)
#define _concat(x,...) x##__VA_ARGS__
#define LanguageHeader(x) stringize(concat(lang_,x).h)
#include LanguageHeader(LANGUAGE)

If you only want a string table for a single language in the executable, you can always use the preprocessor.

And then in a separate file, do:
/* lang_English.h */
const char *StringTable[] = {
     "@a004@s016@i@cffd8af Loading the above save data.",
     "@a004@s016@i@cffd8af If you select it once more, the data will be loaded.",
     "@s024@cffdf3f- No Title."
     /* ... */
};

Name: Anonymous 2012-01-01 19:32

char *name[] and not char **name
IHBT

Name: Anonymous 2012-01-01 22:57

programming stumps me, I mean what the hell does an _ in front of a variable this is not in any of the tutorials i've found and let alone how to get information from the OS and finding information about all library or namespace functions...

what the hell is this suppose to mean?

'char strSaveLoadReadyLoad[] = "@a004@s016@i@cffd8af Loading the above save data.";

Name: Anonymous 2012-01-01 23:08

>>49
__IS_FOR_STANDARD_AND_COMPILERS_ONLY__

Name: Anonymous 2012-01-01 23:34

Recompiling for every supported language considered fucking dumb.

Name: Anonymous 2012-01-01 23:44

>>51
yeah, and what if the person using the product wants to change languages? Could be better to store all these strings in a file and load the file at start up. Or include every string of every language hardcoded into the binary.

Name: Anonymous 2012-01-02 0:23

http://codepad.org/8W6oA0qY

I made my own one. It works pretty well.

You need a directory (in the example, it is just a directory called "translations"). Then you need a file for each language you want to translate into. If you had English and German, for example, you would have the files translations/english and translations/german. Every line in English has to be on the same line-number as its translation in German.

Example output:
[blockquote]$ ./lc.exe
Thank you Based Language Converter (English) = Vielen Dank Based Sprache Conver
er (German)[/blockquote]

Name: Anonymous 2012-01-02 0:26

>>53
Bear in mind I literally spent 30 minutes on this thing, so it's probably not robust.

I'm not sure whether it's better to have the user choose the source and destination languages just-in-time (when calling the Convert method) or ahead-of-time (when constructing the object). The former makes each Convert() call longer and more complex, while the latter requires having multiple objects. I went for the former in the end because I thought it was better, but IDK. Maybe if I was going to maintain that code I'd make it possible to do either.

Name: Anonymous 2012-01-02 1:14

Sorry, but you can't store Japanese characters in a char. You'll need a wchar.... and I'm pretty sure .c and .cpp files have to be ascii, so you'll need to find out the hex values of all those Japanese characters.

Name: Anonymous 2012-01-02 1:29

>>55
tell that to the game that works properly that i ripped it from

Name: Anonymous 2012-01-02 1:49

>>55
Or you could use 8-bit non-ASCII strings at runtime. Instead of figuring out what the hex values need to be, you can just use the corresponding ASCII value. I know of a few games that do this... and probably every 8-bit console game in Japanese does it.

Name: Anonymous 2012-01-02 2:00

ITT: /prog/ on the brink to rediscover utf8

Name: Anonymous 2012-01-02 2:20

>>53
c++ is shit

Name: Anonymous 2012-01-02 2:45

>>55
The code will work fine.

Name: Anonymous 2012-01-02 4:13

>>53
>>54
>not caching at all, not even naive caching
Enjoy your O(n) disk thrashing just to find the same string 1000 times.

Name: Anonymous 2012-01-02 16:49

>>55
and I'm pretty sure .c and .cpp files have to be ascii
Actually the encoding is unspecified. EBCDIC and Shift-JIS are perfectly acceptable character sets for C and C++ source code, that's why there are trigraphs and digraphs.

Name: Anonymous 2012-01-03 0:22

>>59
You're shit. C++ is a better progaming language than you'll ever be

>>61
I spent less than an hour on it. Also I like how you notice the lack of caching but not the fact that it breaks if there's a newline in srcString.

I'll add caching to the list of improvements to be made

Name: Anonymous 2012-01-03 7:04

>>63
To be honest I don't think any person is a good "progaming" language, or even programming language for that matter.

Name: >>64 2012-01-03 7:12

Granted, C++ is a really shitty language, it might so bad that it's actually worse than not having any programming language at all, in which case even people can be better programming languages than C++.

Name: Anonymous 2012-01-03 10:52

>>64
Jews make good programming languages, and even better pro-gaming languages.

Name: Anonymous 2012-01-03 12:43

Christians Did Perl 5!

Name: Anonymous 2012-01-03 13:00

>>64
Jew have been trolled

Name: Anonymous 2012-01-03 13:18

>>66
Jews are even better pogroming languages.

Name: Anonymous 2012-01-03 14:31

>>69
This guy.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List