abh - HTMLify profile

abh's Profile Picture

abh

509 Files

102923 Views

Latest files of /abh/learning/c/BPPL/Phase-3/chatbot

ChatBot abh/learning/c/BPPL/Phase-3/chatbot/main.c
10 Views
0 Comments
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ui.h"
#include "chatbot.h"

char *mirror_chat(char *message) {
return message;
chatbot.c abh/learning/c/BPPL/Phase-3/chatbot/chatbot.c
11 Views
0 Comments
#include <stdlib.h>
#include "chatbot.h"

char *ChatBot_chat(ChatBot *chatbot, char *message) {
if (message == NULL || message[0] == '\0') return NULL;
ChatMsg usermsg = { chatbot->name, message, SEND };
char *response = chatbot->chat(message);
ChatMsg botmsg = { chatbot->name, response, RECEIVE };
chatbot.h abh/learning/c/BPPL/Phase-3/chatbot/chatbot.h
9 Views
0 Comments
#ifndef CHATBOT_H
#define CHATBOT_H

typedef enum {
SEND,
RECEIVE,
} MsgType;

ui.c abh/learning/c/BPPL/Phase-3/chatbot/ui.c
6 Views
0 Comments
#define _XOPEN_SOURCE_EXTENDED
#include <ncursesw/ncurses.h>
#include <string.h>
#include <locale.h>
#include "chatbot.h"
#include "ui.h"

enum {
ui.h abh/learning/c/BPPL/Phase-3/chatbot/ui.h
5 Views
0 Comments
#include "chatbot.h"

typedef enum {
CHAT_SELECT_PAGE,
CHATING_PAGE,
} Page;

void draw_chat_select_page(ChatBot chatbots[], int cbc, int selected);