Ai Dreams Forum

Member's Experiments & Projects => General Project Discussion => Topic started by: unreality on November 21, 2017, 06:58:59 am

Title: c yah!
Post by: unreality on November 21, 2017, 06:58:59 am
Good old c. Not even c++ can touch it in performance or program size.

https://benchmarksgame.alioth.debian.org/u64q/c.html
Title: Re: c yah!
Post by: Korrelan on November 21, 2017, 04:57:21 pm
From the post title I thought someone was leaving lol.

 :)
Title: Re: c yah!
Post by: unreality on November 21, 2017, 07:26:20 pm
Yah, looks like I was one h away from leaving lol
Title: Re: c yah!
Post by: 8pla.net on November 21, 2017, 10:47:36 pm
I love C Language.  I am not saying anything bad about C++, but it is a just super structure.

Title: Re: c yah!
Post by: 8pla.net on November 21, 2017, 11:20:34 pm
This source code is posted strictly for discussion purpose, without any warranty or guarantee of any kind whatsoever.

Code
#include <stdio.h>
#include <string.h>

/* 

    Some C language to begin chatbot design.

*/

int main()
{
  /* DATA */
  char stimulus[72];
  int match;

  /* INPUT */
  printf("Say something: ");
  fgets(stimulus,72,stdin);

  /* PROCESS */
  if (strcasecmp(stimulus, "hello\n") == 0) printf("You greeted me.\n");

  /* OUTPUT */
  printf("You said: %s\n",stimulus);
  return(0);
}

Program Output:
Quote
Tell me something: hello
You greeted me.
You told me: hello


It is simple, but simple is a good place to start sometimes.