I would like to use ProDeo book in my Pascal program. So I started to translate book.c in Pascal.
I allowed myself to give a link to my Google Drive because it seems that the page where I had downloaded the files no longer exists. I hope you don't mind.
My Pascal translation is unfinished and doesn't work. But, which is even more annoying, I discover that I cannot compile the C code. I am under Linux and try to compile with GCC. Here is my attempt:
Code: Select all
[roland@localhost prodeobook]$ gcc book.c -o book book.c: Dans la fonction « FIND_OPENING »: book.c:258:31: warning: déclaration implicite de la fonction « randomize »; vouliez-vous utiliser « random_r » ? [-Wimplicit-function-declaration] clock_t a; a=clock(); randomize(); ^~~~~~~~~ random_r book.c:259:11: error: trop d'arguments pour la fonction « random » x=random(9999); rnd=RND+x; ^~~~~~ In file included from book.c:123: /usr/include/stdlib.h:401:17: note: déclaré ici extern long int random (void) __THROW; ^~~~~~ [roland@localhost prodeobook]$
Could you help me to "fix" the C code, so that it compiles and works?
And after that, could you help me to understand how the code works?
P.-S. I know that there is a rebelbook.dll, with Pascal usage example. I successfully used it in the past. But for now I would like to use ProDeo book under Windows and under Linux. That's why I imagined to do that translation (and also because I am interested in understanding how the book is made).