Skip to main content
MEMORY_ARCHIVE // KOLKATA // EST. 2002

The Beginning.C, Turbo C++, and a Help Library.

This page is not a portfolio. It is a time capsule. Every program here was written before broadband, before Google, before someone else had already solved the problem. Just a student, a compiler, and an obsession.

TURBO C++ IDE F1-Help
FileEditSearchRun CompileDebugProjectOptions WindowHelp
═ MEMORY.C ═
C:\TC\BIN> tc.exe memory.c Turbo C++ Version 3.0 Copyright (c) 1992 Borland International Compiling... Linking... ===== NOSTALGIA.EXE — LOADING MEMORIES ===== Year : 2002 City : Kolkata, West Bengal Tool : Turbo C++ 3.0 Net : NONE Status : The journey begins... C:\TC\BIN> _
F2-Save F3-Load F5-Zoom F6-Switch F7-Trace F8-Step F9-Make F10-Menu Line 1 Col 1
§01 · The First Day · 2002

The Day I Stopped Being Afraid of the Computer.

It was 2002. I had passed my Higher Secondary with First Division. I had never touched a computer. The machines were expensive, surrounded by mythology, and most people kept their distance. A conventional institute in Kolkata offered a Diploma in Programming — C and C++, taught through Turbo C. I enrolled.

The first few days were humbling. I stared at the keyboard. The monitor felt like it was watching me back. Then we reached conditions and loops — and something clicked inside my mind with the clarity of a mathematical proof. I walked up to my instructor with a handwritten formula I had used as a child: a trick for calculating what day of the week any birth date fell on. I asked if I could turn it into a program.

"She smiled. Twenty-four hours later, I had my first real output on screen. And nothing was ever the same again."

That program became everything. Not because it was complex — it wasn't. But because it was mine. Designed from a childhood memory. Converted into logic. Executed by a machine. The Turbo C help library — the only "Google" I had — became my closest companion. Every function, every trick I learned, came from pressing F1 and reading.

§02 · Program 01 · bdate.c · 2002

Birth Date Day Calculator.

My very first self-designed program. Not a tutorial exercise. A childhood formula — Zeller's congruence, though I didn't know its name then — that I had memorised to mentally calculate what day any birth date fell on. I converted it into C code, line by line, entirely from logic.

// Source Code · bdate.c · Turbo C++ 3.0 · 2002
Turbo C++ [bdate.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ bdate.c ═
/* Birth Date Day Calculator — First self-designed program · 2002 */
#include <stdio.h>
#include <conio.h>

int dayOfWeek(int d, int m, int y) {
    static int t[] = {0,3,2,5,0,3,5,1,4,6,2,4};
    if (m < 3) y--;
    return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;
}

void main() {
    int d, m, y;
    char *days[] = {"Sunday","Monday","Tuesday","Wednesday",
                    "Thursday","Friday","Saturday"};
    clrscr();
    printf("\n ===== BIRTH DATE CALCULATOR =====\n");
    printf(" Enter Day   (DD)   : "); scanf("%d", &d);
    printf(" Enter Month (MM)   : "); scanf("%d", &m);
    printf(" Enter Year  (YYYY) : "); scanf("%d", &y);
    printf("\n The day was : %s\n", days[dayOfWeek(d,m,y)]);
    getch();
}
F2-Save F9-Compile F10-MenuLine 18 Col 1 Insert
// Live Demo — Same Algorithm, Running in Your Browser Right Now
═ BDAY.EXE — Live Demo — Running in Browser ═2002 → 2026
===== BIRTH DATE CALCULATOR ===== Enter your birth date:
// Waiting for input...
// Output · Screenshots & Video
🖥️
Screenshot 01
Program Input
// Add real screenshot
INPUT SCREEN · bdate.c · Turbo C 3.0
📟
Screenshot 02
Program Output
// Add real screenshot
OUTPUT · "The day was : MONDAY"
▶️
Video
Program Running
// Add real video
VIDEO · bday.exe running live
§03 · The Discovery · cprintf · 2002

The Day I Discovered cprintf.

Everyone starts with printf. Plain grey-white DOS output. That is all we knew. Then one afternoon, digging through Turbo C's built-in help library — the only "Google" we had — I found cprintf. Colour printf. Set text colour. Set background colour. Print in any combination of the 16 DOS colours.

"The screen wasn't grey anymore. It was alive. It felt like someone had handed me a paintbrush inside a compiler."

Once I had colour, I couldn't stop. Every program got a colour scheme. Every output became a designed experience. The accelerator was found — and from here the speed of learning doubled.

// Source Code · color.c · Turbo C++ 3.0 · 2002
Turbo C++ [color.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ color.c ═
/* Discovering cprintf — the first coloured output · 2002 */
#include <stdio.h>
#include <conio.h>

void main() {
    clrscr();

    textcolor(CYAN);   textbackground(BLACK);
    cprintf("  Hello in CYAN on BLACK!        \r\n");

    textcolor(YELLOW); textbackground(BLUE);
    cprintf("  Hello in YELLOW on BLUE!       \r\n");

    textcolor(WHITE);  textbackground(RED);
    cprintf("  Hello in WHITE on RED!         \r\n");

    textcolor(BLACK);  textbackground(GREEN);
    cprintf("  Hello in BLACK on GREEN!       \r\n");

    textcolor(MAGENTA);textbackground(LIGHTGRAY);
    cprintf("  Hello in MAGENTA on LIGHTGRAY! \r\n");

    getch();
}
F2-Save F9-Compile F10-MenuLine 20 Col 1
// Output
🎨
Screenshot
All 16 DOS Colors
// Add real screenshot
cprintf OUTPUT · color.c · First coloured screen
▶️
Video
Color Demo
// Add real video
VIDEO · color.exe · All DOS color combinations
§04 · Graphics Era · graphics.h · 2003

Ferns, Space, UFOs. DOS Graphics.

After colour came graphics. Turbo C's graphics.h opened a completely different world. The DOS screen could now render pixels, lines, circles — and with a fractal algorithm, a Barnsley fern that grew on screen pixel by pixel. I was mesmerised. I spent weeks drawing: a starfield that scrolled like flying through space, a UFO that animated across the screen, and a simulated Mars landscape. All in C. All in DOS. All original, from the help library alone.

"I was producing visuals nobody around me had seen in a DOS program. That was when I understood: programming was not just logic. It was art."
// Source Code · fern.c · Barnsley Fractal Fern · 2003
Turbo C++ [fern.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ fern.c ═
/* Barnsley Fern — fractal drawn pixel by pixel · 2003 */
#include <graphics.h>
#include <stdlib.h>
#include <conio.h>

void main() {
    int gd = DETECT, gm;
    initgraph(&gd, &gm, "C:\\TC\\BGI");
    double x=0, y=0, nx, ny;
    int i, r, px, py;
    setcolor(GREEN);
    for(i=0; i<100000; i++) {
        r = rand() % 100;
        if      (r < 1)  { nx=0;                   ny=0.16*y; }
        else if (r < 86) { nx=0.85*x+0.04*y;      ny=-0.04*x+0.85*y+1.6; }
        else if (r < 93) { nx=0.20*x-0.26*y;      ny= 0.23*x+0.22*y+1.6; }
        else              { nx=-0.15*x+0.28*y;     ny= 0.26*x+0.24*y+0.44; }
        x=nx; y=ny;
        px=(int)(x*40)+320;
        py=getmaxy()-(int)(y*37);
        putpixel(px, py, GREEN);
    }
    getch(); closegraph();
}
F9-Compile F10-MenuLine 24 Col 1
// Output · fern.c
🌿
Screenshot
Fern Rendered
// Add real screenshot
BARNSLEY FERN · 100,000 pixels · fern.c
▶️
Video
Fern Growing
// Add real video
VIDEO · fern.exe · Watch it grow pixel by pixel
// Source Code · space.c · Starfield + UFO Animation · 2003
Turbo C++ [space.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ space.c ═
/* Starfield + UFO animation — DOS graphics · 2003 */
#include <graphics.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>
#define STARS 150

int sx[STARS], sy[STARS];

void drawUFO(int x, int y) {
    setcolor(CYAN);    ellipse(x,y,0,360,30,10);
    setcolor(YELLOW);  ellipse(x,y-8,0,360,14,8);
    setcolor(WHITE);   circle(x,y-8,4);
}

void main() {
    int gd=DETECT,gm,i,ux=50,uy=100;
    initgraph(&gd,&gm,"C:\\TC\\BGI");
    for(i=0;i<STARS;i++){sx[i]=rand()%640;sy[i]=rand()%480;}
    while(!kbhit()) {
        cleardevice();
        for(i=0;i<STARS;i++){
            putpixel(sx[i],sy[i],WHITE);
            sy[i]=(sy[i]+2)%480;
        }
        drawUFO(ux,uy);
        ux=(ux+3)%getmaxx();
        delay(30);
    }
    closegraph();
}
F9-Compile F10-MenuLine 28 Col 1
// Output · space.c
🌌
Screenshot
Starfield
// Add real screenshot
STARFIELD · space.c · 150 stars scrolling
🛸
Screenshot
UFO Animation
// Add real screenshot
UFO · Cyan ellipse + Yellow dome + White glow
▶️
Video
Full Animation
// Add real video
VIDEO · space.exe · Stars + UFO moving
§05 · The Alien · mars.c · 2003

Chatting With an Alien on Mars.

No internet. No chatbot APIs. So I built my own. A simulated conversation with an alien life form on Mars — rendered in DOS graphics mode with the alien's face drawn using graphics.h, and a text-based response tree handling the conversation. You typed. The alien responded. It was storytelling, logic, and graphics all in one program. All original.

// Source Code · mars.c · DOS Alien Chat · 2003
Turbo C++ [mars.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ mars.c ═
/* Mars Alien Chat Simulation · DOS Graphics · 2003 */
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <graphics.h>

char *resp[] = {
    "Zrrk! Greetings, Earth creature.",
    "We have monitored your planet for 3000 cycles.",
    "Your gravity is... uncomfortable.",
    "Zrrk... does not compute."
};

void drawAlien(int x, int y) {
    setfillstyle(SOLID_FILL,GREEN); fillellipse(x,y,25,30);
    setcolor(RED);   circle(x-10,y-5,5); circle(x+10,y-5,5);
    setcolor(YELLOW);arc(x,y+8,190,350,12);
}

void respond(char *in) {
    if     (strstr(in,"hello")||strstr(in,"hi"))   printf("\n ALIEN> %s",resp[0]);
    else if(strstr(in,"mars")||strstr(in,"planet")) printf("\n ALIEN> %s",resp[1]);
    else if(strstr(in,"earth")||strstr(in,"gravity"))printf("\n ALIEN> %s",resp[2]);
    else                                               printf("\n ALIEN> %s",resp[3]);
}

void main() {
    char input[80];
    int gd=DETECT,gm;
    initgraph(&gd,&gm,"C:\\TC\\BGI");
    drawAlien(320,120);
    getch(); closegraph();
    while(1){
        printf("\n YOU> "); gets(input);
        if(!strcmp(input,"bye")) break;
        respond(input);
    }
}
F9-Compile F10-MenuLine 32 Col 1
// Output · mars.c
👽
Screenshot
Alien Face Rendered
// Add real screenshot
ALIEN FACE · mars.c · graphics.h rendering
▶️
Video
Full Chat Session
// Add real video
VIDEO · mars.exe · Alien conversation running
§06 · Domination · Exam Scores · 2003–2004

When Others Scored 30, I Scored 80+.

By 2003, C and C++ had become second nature. The institute's 100-mark programming examinations exposed the gap clearly. Other students struggled to cross 30–40. My score never fell below 80. Not because I studied harder — but because I had gone far beyond the syllabus on my own, driven purely by curiosity about what the language could do.

🏆
Consistently Highest in C & C++ · Institute Examinations · 2003–2004

100-mark papers. Class average: 30–40. Personal average: 80+. Score never dropped below 80 in any C or C++ paper across the entire course. Not studying more — building more.

This wasn't academic performance. It was the natural result of spending evenings drawing fractal ferns and animating UFOs while the curriculum was still on printf("Hello, World");.

§07 · The Leap · gcpp.h + gcpp2.h · 2004

When DOS Got a GUI. Built from Scratch.

Visual Basic 6 had arrived in the curriculum. Everyone marvelled at the GUI — forms, buttons, message boxes, all provided automatically. I used it. I understood it. And then I asked myself a question that would consume months: Can I build a GUI in DOS mode, in C, from scratch?

Days turned into nights. The code grew: 7,000 lines, then 8,000. I built two custom header files — gcpp.h and gcpp2.h — a complete graphical interface library for DOS mode. Include these two files and in ten lines you had a fully functional GUI: windows, 3D buttons, input fields, dialog boxes, colour fills, event handling.

"VB6 gave everyone a GUI for free. I built one from nothing, in a mode that wasn't supposed to have one. That was the moment I understood what 'programmer' truly meant."
// Header File · gcpp.h (excerpt) · Custom DOS GUI Library · ~7000 lines · 2004
Turbo C++ [gcpp.h]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ gcpp.h ═
/* gcpp.h — Graphical C++ DOS GUI Library · ~7000 lines · 2004
   Include this header: get a full DOS GUI in under 15 lines */
#ifndef GCPP_H
#define GCPP_H
#include <graphics.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>

#define BTN_FACE   7
#define BTN_SHADOW 8
#define BTN_HILITE 15
#define WIN_BG     1

/* ── Draw a 3D raised button ──────────────────────── */
void drawButton(int x,int y,int w,int h,char* label) {
    setfillstyle(SOLID_FILL,BTN_FACE); bar(x,y,x+w,y+h);
    setcolor(BTN_HILITE); line(x,y,x+w,y); line(x,y,x,y+h);
    setcolor(BTN_SHADOW); line(x,y+h,x+w,y+h); line(x+w,y,x+w,y+h);
    setcolor(BLACK);
    outtextxy(x+(w/2)-(strlen(label)*4), y+(h/2)-4, label);
}

/* ── Draw a window with title bar ─────────────────── */
void drawWindow(int x,int y,int w,int h,char* title) {
    setfillstyle(SOLID_FILL,WIN_BG); bar(x,y,x+w,y+h);
    setfillstyle(SOLID_FILL,BTN_FACE); bar(x,y,x+w,y+18);
    setcolor(WHITE); outtextxy(x+4,y+4,title);
    setcolor(BTN_HILITE); rectangle(x,y,x+w,y+h);
}

/* ... (7000+ more lines: input boxes, radio buttons,
   checkboxes, menus, scroll bars, message boxes, event loop) */
#endif
F9-Compile F10-Menu~7000 lines total
// Using the Library — Full DOS GUI in 12 Lines · demo.c
Turbo C++ [demo.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ demo.c ═
/* Full DOS GUI in 12 lines — using gcpp.h + gcpp2.h */
#include "gcpp.h"
#include "gcpp2.h"

void main() {
    int gd=DETECT, gm;
    initgraph(&gd, &gm, "C:\\TC\\BGI");
    drawWindow(100,80,440,300,"My DOS Application");
    drawButton(180,200,100,30,"OK");
    drawButton(310,200,100,30,"Cancel");
    getch();
    closegraph();
}
F9-Compile F10-MenuLine 12 Col 1
// Output · gcpp.h GUI Library
🪟
Screenshot
DOS Window
// Add real screenshot
DOS GUI WINDOW · drawWindow() in action
🖱️
Screenshot
3D Buttons
// Add real screenshot
3D BUTTONS · Highlight + Shadow effect
▶️
Video
Full GUI Demo
// Add real video
VIDEO · demo.exe · Complete DOS GUI running
§08 · The Crown · dpaint.c · 2004–2005

DebB Paint. My Own MS Paint. In DOS.

With the GUI library working, I pushed to the ultimate challenge: build a fully working paint application — like Microsoft MS Paint — running entirely in DOS graphics mode, in C. I called it DebB Paint.

It had everything: draw squares, rectangles, and circles with a single click. Select colour from a palette with a click. Flood-fill shapes. Emboss effect. Engrave effect. A toolbox panel. Keyboard shortcuts. Save and reload drawings. It was the largest single program I had ever written.

"VB6 gave everyone MS Paint as a reference. I built one that ran without Windows. That was my answer to the challenge."
// Source Code · dpaint.c (excerpt) · DebB Paint · 2004
Turbo C++ [dpaint.c]F1-Help
FileEditSearchRunCompileDebugProjectOptions
═ dpaint.c ═
/* DebB Paint — DOS Paint App · 2004
   Draw, Fill, Emboss, Engrave, Color Picker, Toolbox */
#include "gcpp.h"
#include "gcpp2.h"
#include <dos.h>
#define TOOL_RECT   1
#define TOOL_CIRC   2
#define TOOL_FILL   3
#define TOOL_EMBOSS 4
#define TOOL_ENGRAV 5

int curTool=TOOL_RECT, curColor=WHITE;

void emboss(int x1,int y1,int x2,int y2) {
    setcolor(WHITE);    line(x1,y1,x2,y1); line(x1,y1,x1,y2);
    setcolor(DARKGRAY); line(x1,y2,x2,y2); line(x2,y1,x2,y2);
}
void engrave(int x1,int y1,int x2,int y2) {
    setcolor(DARKGRAY); line(x1,y1,x2,y1); line(x1,y1,x1,y2);
    setcolor(WHITE);    line(x1,y2,x2,y2); line(x2,y1,x2,y2);
}
void drawPalette() {
    int i,cols[]={BLACK,BLUE,GREEN,CYAN,RED,MAGENTA,
                   BROWN,LIGHTGRAY,DARKGRAY,YELLOW,WHITE,
                   LIGHTBLUE,LIGHTGREEN,LIGHTCYAN,LIGHTRED,LIGHTMAGENTA};
    for(i=0;i<16;i++){
        setfillstyle(SOLID_FILL,cols[i]);
        bar(10+i*20,getmaxy()-28,28+i*20,getmaxy()-10);
    }
}

void main() {
    int gd=DETECT,gm;
    initgraph(&gd,&gm,"C:\\TC\\BGI");
    drawWindow(0,0,getmaxx(),getmaxy(),"DebB Paint v1.0");
    drawPalette();
    /* Full event loop: mouse click → tool action → draw → fill... */
    getch(); closegraph();
}
F9-Compile F10-Menudpaint.c · Largest program to date
// Output · DebB Paint
🎨
Screenshot
DebB Paint UI
// Add real screenshot
DEBB PAINT · Full UI · Toolbox + Color Palette
▶️
Video
Drawing Demo
// Add real video
VIDEO · dpaint.exe · Draw, Fill, Emboss in action
Screenshot
Shapes
// Add real screenshot
RECT + CIRCLE · Single-click drawing
🪣
Screenshot
Fill + Color
// Add real screenshot
FLOOD FILL + COLOR PICKER
Screenshot
Emboss Effect
// Add real screenshot
EMBOSS + ENGRAVE EFFECTS
The Journey Continues

STORY_STATUS: ONGOING // INIT_2002 · STILL_BUILDING · EST_PRESENT

This Was the Beginning.
The Story Didn't Stop Here.

From Turbo C to enterprise software, from DOS graphics to AI agents — every chapter built on this foundation.

hello@debasisbhattacharjee.com · +91 8777088548