Log in Register Dashboard Temp Share Shortlinks Frames API

abh - HTMLify profile

abh's Profile Picture

abh

523 Files

134561 Views

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

ChatBot abh/learning/c/BPPL/Phase-3/chatbot/main.c
72 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
49 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
71 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
50 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
52 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);