Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet thread from rec.arts.ascii, started 29 Oct 1994.
 _   _                     _        _             _     _           
| | | |___  ___ _ __   ___| |_     / \   _ __ ___| |__ (_)_   _____ 
| | | / __|/ _ \ '_ \ / _ \ __|   / _ \ | '__/ __| '_ \| \ \ / / _ \
| |_| \__ \  __/ | | |  __/ |_   / ___ \| | | (__| | | | |\ V /  __/
 \___/|___/\___|_| |_|\___|\__| /_/   \_\_|  \___|_| |_|_| \_/ \___|
Binary: HEART Program

Binary: HEART Program

rec.arts.ascii · 5 messages · 29 Oct 1994 - 5 Nov 1994
Scott Kahler <sco...@lamar.ColoState.EDU> ASCII art 29 Oct 1994 01:01 · permalink · report
  Here is a heart generator program for all of you love-
  birds out there.  Just save the file, remove these
  lines of text, and then compile using something like
  'cc heart.c' or whatever.  Enjoy!!
 
  _______________________________________________
 /___...@Lamar.Colostate.EDU________   |             |      
|   ________________________________________ /|   |       \           /
|  | | Maybe in order to understand mankind,| |   |  |      _,adbba,_      |
|  | | we have  to look at  the word itself:| |   | =+=   ,d888888888b,   =+=
|  | | "Mankind". Basically, it's made up of| |   |  |    d88888888888b    |
|  | | two separate words -"mank" and "ind".| |   |  Jesus-------------Christ
|  | | What  do  these  words  mean ? It's a| |   |  -----the risen Son------
|  | | mystery,  and  that's   why   so   is| |   | "I  am  the  light  of  the
|  | | mankind.        -Jack Handey         | |   | world: he that followeth me
|  | |______________________________________|_|   | shall not walk in darkness,
|  |/_____________________________________________| but shall have the light of
|________________________________________________/  life"           - John 8:12

/*************Remove aboove this line******************/
/******************************************************/
/******************************************************/
/******************************************************/


/* heart.c written by Paal D. Ekran. (C)94 ESD, Amiga. */

#include "stdio.h"
#include "strings.h"
#include "stdlib.h"

FILE *fp;
int scnt,scale;
char str[512],fname[20];  /* longer str makes it possible to write all over the heart */

void prtch(void);
void prtspc(void);

void main(void){

 int a[21],b[21];
 int cnt,li,scl,foo;
 char scales[4];
  
 for (cnt=0;cnt<20;cnt++) a[cnt]=1;

 a[1]=9; b[1]=20; a[2]=6; b[2]=24; a[3]=4; b[3]=27; a[4]=3; b[4]=28; a[5]=2; 
 b[5]=29; b[6]=29; b[7]=29; b[8]=28; b[9]=28; b[10]=26; b[11]=24; b[12]=22; 
 b[13]=20; b[14]=18; b[15]=16; b[16]=14; b[17]=11; b[18]=7; b[19]=2;

 printf("Heart v1.4 \n\n");
 printf("text: ");
 gets(str);
 printf("file: ");
 gets(fname);
 scale=0;
 while (scale<1 || scale>3) {
  printf("scale [1-3]: ");
  gets(scales);
  scale=atoi(scales);
 }
 if ((fp=fopen(fname,"w"))==NULL) {
  printf("could not open file.\n");
  exit(0);
 }
 printf("\n\n");

 li=1; scnt=0;
 for (li=1; li<=19; li++) {
  for (scl=0; scl<scale; scl++) {
   for (cnt=0; cnt<30-b[li]; cnt++) prtspc();
   for (cnt=0; cnt<b[li]-a[li]; cnt++) prtch();
   foo=a[li]+a[li];
   while (foo>2) {foo--; prtspc(); }
   for (cnt=0; cnt<b[li]-a[li]; cnt++) prtch();
   printf("\n");
   fprintf(fp,"\n");
  }
 }
 
 if (fclose(fp)) printf("file close error.");
}

void prtch(void){   /* prints next char both to stream and screen */
 int no;
 for (no=0; no<scale; no++) {
  printf("%c",str[scnt]);
  fprintf(fp,"%c",str[scnt]);
  scnt++;
  if (str[scnt]==*"\0") scnt=0;
 }
}
void prtspc(void){ /* prints next space both to stream and screen */
 int no;
 for (no=0; no<scale; no++) { 
  printf(" ");
  fprintf(fp," ");
 }
}

Sorry to disappoint you, but your program doesn't work.  The compiler tells
me:

"heart.c", line 10: cannot find include file: "strings.h"

and stops.  What might be causing this?

JP

Jason Fournier <jr...@cs.bu.edu> ASCII art 3 Nov 1994 00:31 · permalink · report
James Perkins (J.P...@hbs.gu.edu.au) wrote:

: Sorry to disappoint you, but your program doesn't work.  The compiler tells
: me:

: "heart.c", line 10: cannot find include file: "strings.h"

: and stops.  What might be causing this?

: JP

I deleted that line, and it works just fine.  I think he was trying
 to include "string.h", not strings.h, but the program does not need
 anything from string.h anyways.  Just delete the line  :)



--
===========================PyroMud: elektra.cc.edu 2222============
    ___    *     ___           ___           ___           ___     
   /  /\        /  /\         /  /\ .       /  /\   +     /__/\    
  /  /:/       /  /::\       /  /:/_       /  /::\        \  \:\   
 /__/::\.     /  /:/\:\ +   /  /:/ /\     /  /:/\:\   .    \  \:\  
 \__\/\:\    /  /:/~/::\   /  /:/ /::\ . /  /:/  \:\   _____\__\:\ 
    \  \:\  /__/:/ /:/\:\ /__/:/ /:/\:\ /__/:/ \__\:\ /__/::::::::\
     \__\:\ \  \:\/:/__\/ \  \:\/:/~/:/ \  \:\ /  /:/ \  \:\~~\~~\/
 +   /  /:/  \  \::/       \  \::/ /:/   \  \:\  /:/   \  \:\  ~~~ 
    /__/:/    \  \:\  .   * \__\/ /:/     \  \:\/:/     \  \:\     
    \__\/    . \  \:\         /__/:/ *     \  \::/ .     \  \:\    
                \__\/         \__\/         \__\/         \__\/ *   
========jr...@csa.bu.edu=============================================

On 2 Nov 1994, James Perkins wrote:

> Sorry to disappoint you, but your program doesn't work.  The compiler tells
> me:
> 
> "heart.c", line 10: cannot find include file: "strings.h"
> 
> and stops.  What might be causing this?

You dont have your include dir's setup correctly for your compiler, 
or(most likely) the compiler isnt searching the directory where the 
strings.h header is stored. If u r using gcc(also cc I think), the 
-I/this/is/the/dir/where/strings.h/is flag tells the compiler to check 
out the dir named. Read the man pages on gcc or cc for more info.


Nick

Chris <mpu...@central.sussex.ac.uk> ASCII art 5 Nov 1994 01:47 · permalink · report
James Perkins (J.P...@hbs.gu.edu.au) wrote:

|> Sorry to disappoint you, but your program doesn't work.  The compiler tells
|> me:

|> "heart.c", line 10: cannot find include file: "strings.h"

|> and stops.  What might be causing this?

I had the same problem.  First replace the "" around with <>.  This
allowed it to find any headers.  (Don't know why my machine at home can
take "" for local and include libs but the one here can't).  Then after
scanning the code I found it seemed to be standard string stuff. So
replace strings.h with string.h.   Worked for me.

Hope this helps.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ___ _          _                                mpu...@central.susx.ac.uk
  / __\ |__  _ __(_)__                 _           mpu...@cogs.susx.ac.uk
 / /  | '_ \| '__| / _\ ___  __ _ _ __| | ___ 
/ /___| | | | |  | \ \ / _ \/ _` | '__| |/ _ \
\____/|_| |_|_|  |_|\ \  __/ (_| | |  | |  __/
                   \__/\___|\__,_|_|  |_|\___|

About this thread. These messages were posted publicly to the newsgroup rec.arts.ascii in 1994 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post