Search:

Type: Posts; User: richardpd

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    8,948

    Hi I use a Win8 desktop PC with MinGW installed...

    Hi
    I use a Win8 desktop PC with MinGW installed and I mainly use Geany4Windows to edit and compile my C programs (there are many other C compilers for Windows eg PellesC/ LCC/TDM/TinyC, as well as...
  2. Replies
    26
    Views
    2,020

    Matticus Do I mean like this?? I do not know....

    Matticus

    Do I mean like this??
    I do not know.
    However after I used my modified version of your code it appears I may mean like that.

    The code I originally used to swap array values is shown...
  3. Replies
    26
    Views
    2,020

    SERIOUSLY!!? What the xxxx is the matter with...

    SERIOUSLY!!?

    What the xxxx is the matter with you phantomotap?

    It is so clear what perspective I have put on this chess board array! See the board array!:
    char board...
  4. Replies
    26
    Views
    2,020

    Jim OK, so I forgot to reply about your...

    Jim

    OK, so I forgot to reply about your comment about boardTemp.
    That was my attempt to do an array index swap which hasn't worked,
    and that surely was not difficult to see (it uses the same...
  5. Replies
    26
    Views
    2,020

    Jim board[52]; isn't a magic number....it...

    Jim
    board[52]; isn't a magic number....it represents board square e2 in the board[64] array. Every board index maps to the chessboard square coordinates which is how the user enters the moves. Do...
  6. Replies
    26
    Views
    2,020

    Hi Jim Firstly this is a very basic start to a...

    Hi Jim

    Firstly this is a very basic start to a very basic chess program in C. Many thanks for your helpful comments.

    There are many ways to represent a chessboard in programming and I know of...
  7. Replies
    26
    Views
    2,020

    Hi Jim Thanks for your reply. Yes I should use...

    Hi Jim
    Thanks for your reply.
    Yes I should use a loop to print the board. I will look at an implementation...

    The whole sourcefile I am just playing around with at present, but here it is:

    ...
  8. Replies
    26
    Views
    2,020

    This code: printf("White move ""From square""...

    This code:
    printf("White move ""From square"" %c%c\n",wmove[0],wmove[1]); //e2 board[52] 'P'
    printf("White move ""To square"" %c%c\n",wmove[2],wmove[3]); //e4 board[36] '-'
    ...
  9. Replies
    26
    Views
    2,020

    Great...I think this is clear to me now...

    Great...I think this is clear to me now (certainly much clearer until I make my next cock up/mistake somehow!?! Hopefully I won't mess up so much now.). Many thanks.

    I have another problem I'm...
  10. Replies
    26
    Views
    2,020

    Thanks Absurd for your helpful explanation. ...

    Thanks Absurd for your helpful explanation.

    What happens in the case of
    char wmove[8] = ""; ?
    This appears to create an empty string and the code works in my case.How (& to what) is the string...
  11. Replies
    26
    Views
    2,020

    Thanks for the replies all. I really do not...

    Thanks for the replies all. I really do not understand this yet though.

    This works (as per Absurds suggestion):

    char wmove[8] = {0};
    and this works (as per laserlights suggestion)

    char...
  12. Replies
    26
    Views
    2,020

    Thanks Absurd..that works! Nice & prompt reply. ...

    Thanks Absurd..that works! Nice & prompt reply.

    I obviously do not fully understand initialising char/int arrays !

    For example are...


    char wmove[8]={0}; and char wmove[8]="0";...
  13. Replies
    26
    Views
    2,020

    String array prints unwanted character

    In my playchessgame function the user/s enter/s move strings and I am trying to save these to a gamehistory string.
    However, when the gamehistory string prints it starts with a stray unwanted...
  14. Replies
    15
    Views
    5,321

    Yep..that's it AFAIK. It just adds a newline...

    Yep..that's it AFAIK. It just adds a newline...
  15. Replies
    15
    Views
    5,321

    Matticus..I've spent the last 2 evenings revising...

    Matticus..I've spent the last 2 evenings revising my existing C code on my PC and googling for new learn C posts/articles/info, in an attempt to be able to code in C more easily (with more...
  16. Replies
    15
    Views
    5,321

    I had a strong feeling that you would say that...

    I had a strong feeling that you would say that and I absolutely agree with you, even though it is a very tedious pocess for me as a self taught, limited skill and limited experienced amateur...
  17. Replies
    15
    Views
    5,321

    So far my attempts using isdigit() have changed...

    So far my attempts using isdigit() have changed the FEN string digit char to a dash ('-'). The code only still gives me a single dash where I need a multiple from 1-8.

    I have not yet been able to...
  18. Replies
    15
    Views
    5,321

    Matticus again many thanks. I am having...

    Matticus again many thanks. I am having difficulty concentrating on this and I do apologise. I looked at info on isdigit() a couple of days ago and promptly forgot what the detail was and I need...
  19. Replies
    15
    Views
    5,321

    Thanks very much for the follow up and...

    Thanks very much for the follow up and pseudocode. My first attempt is apallingly disastrous! Such a simple piece of code but I have screwed it up, and it is sad and embarrasing.


    #include...
  20. Replies
    15
    Views
    5,321

    Thanks for your suggestion Matticus. So far...

    Thanks for your suggestion Matticus. So far though, my efforts with isdigit() have not resulted in anything helpful yet. I will keep plugging away at it and am still grateful for anymore helpful...
  21. Replies
    15
    Views
    5,321

    Simple parsing and printing FEN string

    My simple C programming and chess learning continues as I start looking at a FEN parser in C. I'm just learning this and have adapted some code use strtok();

    The code:

    #include <stdio.h>...
  22. Thanks cyberfish for your post on this-I...

    Thanks cyberfish for your post on this-I appreciate your helpful comments :-)
  23. Excellent c99tutorial -very clear and helpful...

    Excellent c99tutorial -very clear and helpful reply and advice. Many thanks :-)
  24. Thanks for your replies. The actual code using...

    Thanks for your replies.
    The actual code using this is something like:


    printf("\"help\" displays a list of commands.\n");
    for (;;){
    if (!strcmp(s, "help")) {
    //bunch more...
  25. What do these 2 semicolons in the for loop mean eg for (;;)?

    I came across this just now & don't know what it means (but feel I should know ie I'm sure I knew once but have forgotten now!). What do these 2 semicolons at the start of a for loop mean eg
    for...
Results 1 to 25 of 55
Page 1 of 3 1 2 3