From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12866 invoked from network); 20 Aug 2023 10:00:57 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 20 Aug 2023 10:00:57 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob0.topicbox.com (Postfix) with ESMTP id 5F40F2D4A9 for ; Sun, 20 Aug 2023 06:00:54 -0400 (EDT) (envelope-from bounce.mM5a95ba86fc8531e7668aa924.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id 59D2216B9461; Sun, 20 Aug 2023 06:00:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=from:to :message-id:date:mime-version:content-type :content-transfer-encoding:list-help:list-id:list-post :list-subscribe:reply-to:subject:list-unsubscribe; s=dkim-1; t= 1692525654; x=1692612054; bh=U6YJ1Rme/PgR7cq4NckhCZ4fA3vu89h5WnM /A7v0QWs=; b=MQuL8i+ibJA9t46hAbTAF+pDdyz02s0VSTLa5Z/+VomfmkUX7V1 8ePW2Tl97VUcbOh5j0WuHdlgVnZc8Utmoiq/kYI9rbG/Kx8pQGmTzGg76end1FTs 95iSND8JBIQH+HODrWopCutkY0JCSG5Hx+efb8vKbQp1GmSwTn73Srds= From: plan6@room3420.net To: 9fans <9fans@9fans.net> Message-Id: <16925256420.2CAEa1.581760@composer.9fans.topicbox.com> Date: Sun, 20 Aug 2023 06:00:42 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=16925256421.3a3e5Db.581760 Content-Transfer-Encoding: 7bit Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 6cc0316e-3f40-11ee-b925-e19d232d11b0 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UY2I2NjYzNjdmN2VjM2FmNS1NNWE5NWJhODZmYzg1MzFlNzY2OGFh?= =?UTF-8?B?OTI0Pg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] Learning C the hard way List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M5a95ba86fc8531e7668aa924:1:Mudxc0VDZbbIi1kpxq5AFmZtvFT_EL6WTugoqKj7pPA --16925256421.3a3e5Db.581760 Date: Sun, 20 Aug 2023 06:00:42 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, I made a mistake. Holiday time and I just took my 9front x230 with me, thinking it will be en= ough to learn C the hard way. With man pages and sources. I was wrong :/ nsurf is cool, but kind of slow and I'm stuck with my very first program. A= very ridiculous chess UI (in text mode) I intend to develop to play with m= y daughters on an SSH connection on the same user space. Don't mind the chess context. I just want to move chars in a double array a= nd print the array. I made what I thought a logic approach but it works only with the first mov= e. I know it's not the place to ask this kind of help, because, obviously it w= on't help 9front or the community in any way and it's just a personal probl= em due to the fact that I'm not the sharpest tool in the shed and that aski= ng questions about C when it's not ANSI makes people turn crazy. But maybe someone is bored and have some time to debug this very short prog= ram :) (Suppr or Del to quit). Here we go (and thanks for reading) : ************************************************************************* #include #include #include /* define the rows of the chessboard */ char chess[8][10] =3D =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {"8 RCBQKBCR", "7 bbbbbbbb", "6 = ........", "5 ........", =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "4 ........", "3 ........", "2 w= wwwwwww", "1 rcfqkfcr"}; /* print the chessboard */ void printboard(void) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for(int n=3D0; n<8; n++) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 for(int i=3D0; i<10; i++) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print(" %c", chess[n][i]); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print("\n"); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print("\n"); } /* array for the move coordinates */ int coord[] =3D {0, 0, 0, 0}; int player =3D 1; /* get the move coordinates from the player */ /* exceptions will be treated later */ void coordinates(void) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (player =3D=3D 1) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 player =3D 2; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print("Whites Enter Coordinates: "); } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 player =3D 1; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print("Blacks Enter Coordinates: "); } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for(int i =3D 0; i < 4; i++) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 char x =3D getchar(); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 if ((x >=3D 'A' && x <=3D 'H') || (x >=3D 'a' && x <=3D 'h'= )) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 switch (x) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case 'a': coord[i] =3D 2; break; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0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0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case '7': coord[i] =3D 1; break; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case '8': coord[i] =3D 0; break; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } } /* ************************************************************* */ void main() { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 print("\n"); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printboard(); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while(1) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 coordinates(); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 /* 0-1 and 2-3 inverted because rows before columns */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 char last =3D chess[coord[1]][coord[0]]; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 chess[coord[1]][coord[0]] =3D '.';=C2=A0 /* moved pieces ma= ke the case empty, so '.' */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 chess[coord[3]][coord[2]] =3D last; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print("\n%c\n", last);=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 /* just to check last */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 print("\n"); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 printboard(); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 exits(0); } ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tcb666367f7ec3af5-M5a95b= a86fc8531e7668aa924 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --16925256421.3a3e5Db.581760 Date: Sun, 20 Aug 2023 06:00:42 -0400 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Well, I made a mistake.
Holida= y time and I just took my 9front x230 with me, thinking it will be enough t= o learn C the hard way.
With man pages and sources.
I was wrong :/

nsurf is cool, but= kind of slow and I'm stuck with my very first program. A very ridiculo= us chess UI (in text mode) I intend to develop to play with my daughters on= an SSH connection on the same user space.

Don't mind the chess context. I just want to move chars in a double ar= ray and print the array.
I made what I thought a logic appr= oach but it works only with the first move.

I know it's not the place to ask this kind of help, because, obviousl= y it won't help 9front or the community in any way and it's just a = personal problem due to the fact that I'm not the sharpest tool in the = shed and that asking questions about C when it's not ANSI makes people = turn crazy.

But maybe someone is bored and= have some time to debug this very short program :)
(Suppr = or Del to quit).

Here we go (and thanks fo= r reading) :

*****************************= ********************************************

#include <u.h>
#include <libc.h>
=
#include <stdio.h>

/* define th= e rows of the chessboard */
char chess[8][10] =3D
        {"8 RCBQKBCR", = "7 bbbbbbbb", "6 ........", "5 ........",
        "4 ........&qu= ot;, "3 ........", "2 wwwwwwww", "1 rcfqkfcr"= };

/* print the chessboard */
<= div>void
printboard(void) {
  &nb= sp;     for(int n=3D0; n<8; n++) {
&= nbsp;           &nbs= p;   for(int i=3D0; i<10; i++) {
  &= nbsp;           &nbs= p; print(" %c", chess[n][i]);
   &= nbsp;            }
          =       print("\n");
 = ;       }
   &= nbsp;    print("\n");
}

/* array for the move coordinates */
int coord[] =3D {0, 0, 0, 0};
int player =3D 1;

/* get the move coordinates from the player */
=
/* exceptions will be treated later */
void
coordinates(void) {

 &nbs= p;      if (player =3D=3D 1) {
&nb= sp;            =    player =3D 2;
     &n= bsp;          print("Whit= es Enter Coordinates: "); }
    &n= bsp;   else {
      = ;          player =3D 1;
=
          &nbs= p;     print("Blacks Enter Coordinates: "); }=

       = ; for(int i =3D 0; i < 4; i++) {
    = ;            char x = =3D getchar();
       &n= bsp;        if ((x >=3D 'A' &= amp;& x <=3D 'H') || (x >=3D 'a' && x <= ;=3D 'h'))
      &nbs= p;            &= nbsp;    switch (x) {
   &nbs= p;            &= nbsp;           &nbs= p;   case 'a': coord[i] =3D 2; break;
&nb= sp;            =             &nb= sp;      case 'b': coord[i] =3D 3; break;<= br />
          = ;            &n= bsp;         case 'c': coor= d[i] =3D 4; break;
      &nbs= p;            &= nbsp;            cas= e 'd': coord[i] =3D 5; break;
   &nb= sp;            =             &nb= sp;   case 'e': coord[i] =3D 6; break;
&n= bsp;            = ;            &n= bsp;      case 'f': coord[i] =3D 7; break;=
         &nbs= p;            &= nbsp;         case 'g': coo= rd[i] =3D 8; break;
      &nb= sp;            =              ca= se 'h': coord[i] =3D 9; break;
   &n= bsp;            = ;            &n= bsp;   }
      &nbs= p;         else if (x >=3D '= 1' && x <=3D '8')
   =             &nb= sp;        switch (x) {
=             &nb= sp;            =        case '1': coord[i] =3D 7; brea= k;
         &n= bsp;            = ;          case '2': c= oord[i] =3D 6; break;
      &= nbsp;           &nbs= p;             = case '3': coord[i] =3D 5; break;
   =             &nb= sp;            =     case '4': coord[i] =3D 4; break;
            &n= bsp;            = ;       case '5': coord[i] =3D 3; bre= ak;
         &= nbsp;           &nbs= p;          case '6': = coord[i] =3D 2; break;
      =             &nb= sp;            = case '7': coord[i] =3D 1; break;
   = ;            &n= bsp;            = ;    case '8': coord[i] =3D 0; break;
            &= nbsp;           &nbs= p;       }
   =      }
}

/* ************************************************************* */

void
main() {
=
        print("\n&= quot;);
        printboa= rd();

      =   while(1) {

    =             coordina= tes();

      = ;         /* 0-1 and 2-3 inverted b= ecause rows before columns */
     = ;           char last =3D= chess[coord[1]][coord[0]];
     &= nbsp;          chess[coord[1]]= [coord[0]] =3D '.';  /* moved pieces make the case empty, so &= #39;.' */
       &nb= sp;        chess[coord[3]][coord[2]] =3D= last;

      = ;          print("\n%c\n&= quot;, last);          &n= bsp;         /* just to check last = */

      &nb= sp;         print("\n");<= br />

       =          printboard();
<= div>        }

        exits(0);
}



= --16925256421.3a3e5Db.581760--