view src/kaigo/horori/console/xor.cpp @ 60:058fb0a2cda8

fix eraline.
author pyon@macmini
date Fri, 14 Aug 2020 03:31:29 +0900
parents 05f3d51ad966
children
line wrap: on
line source

/* console.cpp
 *  Last Change: 2020-04-28 火 18:26:49.
 *                            by T.Mutoh
 */
#include "wx/wxprec.h"

#include <wx/wx.h>
#include <wx/app.h>
#include <wx/cmdline.h>

static const wxCmdLineEntryDesc cmdLineDesc[] =
{
	{wxCMD_LINE_SWITCH, "h", "help", "show this help message",
		wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP},
	{wxCMD_LINE_SWITCH, "d", "dummy", "a dummy switch",
		wxCMD_LINE_VAL_NONE, 0},
	{wxCMD_LINE_SWITCH, "s", "secret", "a secret switch",
		wxCMD_LINE_VAL_NONE, wxCMD_LINE_HIDDEN},
	// ... your other command line options here...

	wxCMD_LINE_DESC_END
};

int main(int argc, char **argv)
{
	wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "program");

	wxInitializer initializer;
	if (!initializer) {
		fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
		return -1;
	}

	wxString s = argv[1];
	//wxString buf = argv[2];
	int x = wxAtoi(argv[2]);
	wxString t;

	for (int i = 0; i < s.Len(); i++) {
		t += wxString::Format(wxT("%c"), s[i].GetValue() ^ x); 
	}
	wxPrintf(t + wxT("\n"));

	return 0;
}