Hinweis: Das Forum wird geschlossen! Neue Registrierungen sind nicht mehr möglich!

 Zurück zu Pro-Linux   Foren-Übersicht   FAQ     Suchen    Mitgliederliste
How To Write a Rap / House / Disco Song

 
Neuen Beitrag schreiben   Auf Beitrag antworten    Pro-Linux Foren-Übersicht -> Fun&Joke
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
heinrich



Anmeldungsdatum: 22.09.1999
Beiträge: 219
Wohnort: N49.137 E8.544

BeitragVerfasst am: 16. Jul 2001 21:43   Titel: How To Write a Rap / House / Disco Song

How To Write a Rap / House / Disco Song
***************************************

code:

#include <stdio.h>
#include <stdlib.h>

static char col1[6][30] = {
"Move it",
"Get up",
"Pump it up",
"Get down",
"Shake it",
"Pump the jam"
};

static char col2[6][30] = {
"to triple beat",
"get body heat",
"feel the beat",
"get around",
"the joint is jumpin'",
"feet are stompin'"
};

static char col3[6][30] = {
"in the city streets\n",
"you'll be humpin'\n",
"'til the night is over\n",
"shake your meat\n",
"I'm bustin' loose\n",
"with disco heat\n"
};


void chorus(int chor[2][3])
{
int i;

printf("\n(chorus)\n");
for (i = 0; i < 2; i++)
printf("%s %s %s",col1[chor[i][0]],
col2[chor[i][0]],
col3[chor[i][0]]);
printf("\n");
}

void verse(void)
{
int i;

for (i = 0; i < 4; i++)
{
printf("%s %s %s",col1[rand()%6],
col2[rand()%6],
col3[rand()%6]);
}
}

void lastline(int chor[2][3])
{
int i;

for (i = 0; i < 17; i++)
{
printf("%s %s %s",col1[chor[1][0]],
col2[chor[1][0]],
col3[chor[1][0]]);
}
}

void main(void)
{
int chor[2][3];
int i;
int j;
// int getpid();
long now;

/* Generate random seed */
now = time(&now) / rand();
// srand(getpid() + (int)((now >> 16) + now + time(&now)));
srand((int)((now >> 16) + now + time(&now)));

/* Generate chorus and title */
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
chor[i][j] = rand() % 6;
printf("\n\"%s\" by Mixmastermeatbeaters\n\n",col1[chor[0][0]]);

/* Print out song */
verse();
chorus(chor);
verse();
chorus(chor);
lastline(chor);
printf("-----\n");
}

 
Benutzer-Profile anzeigen Private Nachricht senden AIM-Name

Leander Hanwald
Gast





BeitragVerfasst am: 16. Jul 2001 22:09   Titel: Re: How To Write a Rap / House / Disco Song

Habe ich schonmal erwähnt das ich Pascal viel besser finde? Wink
 

Jochen
Gast





BeitragVerfasst am: 17. Jul 2001 7:31   Titel: Re: How To Write a Rap / House / Disco Song

Hmm. Pascal eignet sich aber eher für Kantaten à la J.S. Bach!
 

Descartes
Gast





BeitragVerfasst am: 18. Jul 2001 19:02   Titel: Re: How To Write a Rap / House / Disco Song

Und ein Port zu Win32 damit auch unsere Windows-Freunde sich ihre Songs mit C/C++ erzeugen können
code:

#include <stdio.h> // printf()
#include <stdlib.h> // rand(), srand()
#include <time.h> // time()
#ifndef WIN32
#include <unistd.h> // getpid()
#endif

static char col1[6][30] = {
"Move it",
"Get up",
"Pump it up",
"Get down",
"Shake it",
"Pump the jam"
};

static char col2[6][30] = {
"to triple beat",
"get body heat",
"feel the beat",
"get around",
"the joint is jumpin'",
"feet are stompin'"
};

static char col3[6][30] = {
"in the city streets\n",
"you'll be humpin'\n",
"'til the night is over\n",
"shake your meat\n",
"I'm bustin' loose\n",
"with disco heat\n"
};


void chorus(int chor[2][3])
{
int i;

printf("\n(chorus)\n");
for (i = 0; i < 2; i++)
printf("%s %s %s",col1[chor[i][0]],
col2[chor[i][0]],
col3[chor[i][0]]);
printf("\n");
}

void verse(void)
{
int i;

for (i = 0; i < 4; i++)
{
printf("%s %s %s",col1[rand()%6],
col2[rand()%6],
col3[rand()%6]);
}
}

void lastline(int chor[2][3])
{
int i;

for (i = 0; i < 17; i++)
{
printf("%s %s %s",col1[chor[1][0]],
col2[chor[1][0]],
col3[chor[1][0]]);
}
}

void main(void)
{
int chor[2][3];
int i;
int j;
// int getpid();
long now;

/* Generate random seed */
now = time(&now) / rand();
#ifndef WIN32
srand(getpid() + (int)((now >> 16) + now + time(&now)));
#else
srand((int)((now >> 16) + now + time(&now)));
#endif
/* Generate chorus and title */
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
chor[i][j] = rand() % 6;
printf("\n\"%s\" by Mixmastermeatbeaters\n\n",col1[chor[0][0]]);

/* Print out song */
verse();
chorus(chor);
verse();
chorus(chor);
lastline(chor);
printf("-----\n");
}

 

TuX
Gast





BeitragVerfasst am: 21. Jul 2001 19:21   Titel: Re: How To Write a Rap / House / Disco Song

@Descartes
Im Win32-Port ist aber noch ein kleiner Fehler: statt #ifndef WIN32 muss es #ifndef __WIN32__ heissen...

code:
#include <stdio.h> // printf()
#include <stdlib.h> // rand(), srand()
#include <time.h> // time()
#ifndef __WIN32__
#include <unistd.h> // getpid()
#endif

static char col1[6][30] = {
"Move it",
"Get up",
"Pump it up",
"Get down",
"Shake it",
"Pump the jam"
};

static char col2[6][30] = {
"to triple beat",
"get body heat",
"feel the beat",
"get around",
"the joint is jumpin'",
"feet are stompin'"
};

static char col3[6][30] = {
"in the city streets\n",
"you'll be humpin'\n",
"'til the night is over\n",
"shake your meat\n",
"I'm bustin' loose\n",
"with disco heat\n"
};


void chorus(int chor[2][3])
{
int i;

printf("\n(chorus)\n");
for (i = 0; i < 2; i++)
printf("%s %s %s",col1[chor[i][0]],
col2[chor[i][0]],
col3[chor[i][0]]);
printf("\n");
}

void verse(void)
{
int i;

for (i = 0; i < 4; i++)
{
printf("%s %s %s",col1[rand()%6],
col2[rand()%6],
col3[rand()%6]);
}
}

void lastline(int chor[2][3])
{
int i;

for (i = 0; i < 17; i++)
{
printf("%s %s %s",col1[chor[1][0]],
col2[chor[1][0]],
col3[chor[1][0]]);
}
}

void main(void)
{
int chor[2][3];
int i;
int j;
// int getpid();
long now;

/* Generate random seed */
now = time(&now) / rand();
#ifndef __WIN32__
srand(getpid() + (int)((now >> 16) + now + time(&now)));
#else
srand((int)((now >> 16) + now + time(&now)));
#endif
/* Generate chorus and title */
for (i = 0; i < 2; i++)
for (j = 0; j < 3; j++)
chor[i][j] = rand() % 6;
printf("\n\"%s\" by Mixmastermeatbeaters\n\n",col1[chor[0][0]]);

/* Print out song */
verse();
chorus(chor);
verse();
chorus(chor);
lastline(chor);
printf("-----\n");
}

 

Beiträge vom vorherigen Thema anzeigen:   
     Pro-Linux Foren-Übersicht -> Fun&Joke Alle Zeiten sind GMT + 1 Stunde
Seite 1 von 1

 
Gehen Sie zu:  

Powered by phpBB © phpBB Group
pro_linux Theme © 2004 by Mandaxy