hgm wrote:There are many GUIs that can annotate a set of games in a PGN file on each move with scores and PVs from any engine. Why not use those, and then write a script to to do the calculation on the scores read from the annotated file?
My plan is to compile my simple script, working version is 800 bytes, into an executable for linux and another for windows. When it's working, I'll try to revamp the analysis process to, for example, search deeper when blunders are spotted, or perhaps run a second search using another engine. Perhaps the gui's offer analysis but I'd guess their 'blunder checking' is as primitive as my 800 character bash script.
Indirect perks - I'll learn to compile and code in C++, and have fun for a few weeks.
Am figuring out how to compile. my OS is linux. am totally new to compiling and c/c++.
try #1: testA.cpp
Code: Select all
#include <iostream>
#include <string>
using namespace std;
int main() {
string who;
string name;
who = "myself";
cout << "i'll kick " << who << " in the pants if this works" << endl;
//int age = 0;
//cout << "how many legs do you have?\n";
//cin >> age;
//name="jesse";
//cout << name << " has "<< age << " legs\n";
return 0;
}
linux compile: success
Code: Select all
$ g++ testA.cpp -o main
$ file main
main: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x0b6421fd11a8f9edca8eb982357cc2dc707ace86, not stripped
$ ./main
i'll kick myself in the pants if this works
windows 32-bit & 64-bit compiles: failed
Code: Select all
$ i586-mingw32msvc-cc testA.cpp -o main.exe
/tmp/ccBzFHZg.o:main.cpp:(.text+0xe): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
/tmp/ccBzFHZg.o:main.cpp:(.text+0x52): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/tmp/ccBzFHZg.o:main.cpp:(.text+0x8b): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
Why did testA.cpp fail to compile as an exe and what should I try?
try #2: hello.c
Code: Select all
$ cat hello.c
#include "stdio.h" // Include the standard C library
int main()
{
printf("If I were a compiler, what would I ouput? :wq \n");
return 0;
}
32-bit exe compile - runs
$ i586-mingw32msvc-cc hello.c -o test.exe
$ file test.exe
test.exe: PE32 executable (console) Intel 80386, for MS Windows
$ wine test.exe
If I were a compiler, what would I ouput? :wq
64-bit exe compile - runs
$ x86_64-w64-mingw32-gcc hello.c -o test.exe
$ file test.exe
test.exe: PE32+ executable (console) x86-64, for MS Windows
$ wine test.exe
If I were a compiler, what would I ouput? :wq
64-bit linux compile - runs
$ gcc hello.c -o test
$ file test
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x3973bbf76244d6ea2f8ace0a23a638a6f94625c9, not stripped