Newsgroups: soc.culture.spain,rec.sport.soccer
Subject: Spanish league fixtures (SOCCER)
Supersedes: <92253.130237CERVERON@EVALUN11.BITNET>
Organization: Valencia University (Universitat de Valencia) SPAIN
Date: Wednesday, 9 Sep 1992 13:06:42 EST
From: <CERVERON@EVALUN11.BITNET>

Hi, folks! [Voy a escribir este 'post' en mi ingles macarronico -por cierto
manyana tengo un examen de ingles- porque sorprendentemente :-) hay muchos
seguidores de la liga espanyola que no son hispanoparlantes]

  I've written a simple C program that outputs the league fixtures for
Spanish Soccer First Division '92-'93. It's shorter and less boring than
copying all matches by hand, and, with few changes, it may serve for future
seasons.
  I've used TURBO C (*Borland), but it's quite standard to be used
with other C compilers. If you haven't C compiler: what the hell are you
doing, men??.

----  CUT HERE ------------------------------
/* @Vicente Cerveron - 1992 */

#include <stdio.h>

#define TEAMS   20
#define ROUNDS  (TEAMS-1)
#define LAST    (TEAMS-1)
#define STL     (TEAMS-2)
#define PAIRS   (TEAMS/2)

char names[TEAMS][15]={
  "Albacete","Ath.Bilbao","At.Madrid","Barcelona","Burgos",
  "Cadiz","Celta","Deportivo","Espanyol","Logronyes",
  "Osasuna","Oviedo","Rayo","R.Madrid","R.Sociedad",
  "Sevilla","Sporting","Tenerife","Valencia","Zaragoza"};

char dates[ROUNDS*4]={6,9,13,9,20,9,27,9,4,10,7,10,18,10,25,10,1,11,
  8,11,22,11,29,11,6,12,13,12,20,12,3,1,10,1,17,1,24,1,
  31,1,7,2,14,2,21,2,28,2,7,3,14,3,21,3,4,4,11,4,18,4,2,5,9,5,16,5,
  23,5,30,5,6,6,13,6,20,6};

char odds[TEAMS]={19,8,   1,5,   9,11, 18,12,  7,6,
                    0,15, 16,10,  4,14,  3,13,  2,17};
char even[TEAMS];

show(pairs)
char *pairs;
  {
  int i;
  for(i=0;i<PAIRS;i++)
    printf("---%15s - %-15s---\n",
      names[pairs[2*i]], names[pairs[2*i+1]]);
  printf("\n");
  }

header(round)
int round;
  {
  int i,j;
  j=(i=round*2-2)+ROUNDS*2;
  printf("     %2dr     %02d.%02d / %02d.%02d     %2dr     \n",
    round,dates[i],dates[i+1],dates[j],dates[j+1],round+ROUNDS);
  }

main() {
  int round,i;
  printf("    Spanish First Division  '92-'93\n\n");

    round=1;
    header(1);
    show(odds);

  for(round=2;round<STL;round++) {
    header(round);
    even[0]=odds[1];
    even[1]=odds[STL];
    for(i=2;i<TEAMS;i++) {
      even[i]=odds[i+1];
      i++;
      even[i]=odds[i-3];
      }
    show(even);
    ++round;
    header(round);
    odds[0]=even[0];
    odds[STL]=even[1];
    odds[LAST]=even[LAST];
    for(i=1;i<STL;i++)
      odds[i]=even[i+1];
    show(odds);
    }

    header(round);  /* SECOND-TO-LAST */
    even[0]=odds[STL];
    even[1]=odds[1];
    for(i=2;i<TEAMS;i++) {
      even[i]=odds[i+1];
      i++;
      even[i]=odds[i-3];
      }
    show(even);
    ++round;   /* LAST */
    header(round);
    odds[LAST]=even[0];
    for(i=0;i<LAST;i++)
      odds[i]=even[i+1];
    show(odds);
  }
----  CUT HERE  ------------------------------------------------------
Later, dudes

email to: cerveron@vm.ci.uv.es        ______/..._ ^France-Europe
smile to: Vicente Cerveron           |..Spain  /
                                     | :     */ Valencia
                 , _ ,               |_:_  __/
spanish products   n    from Spain       \/
Xref: sparky soc.culture.spain:2988 rec.sport.soccer:12549