Skip to content

Commit bdc56be

Browse files
committed
Add Zig port documentation
1 parent 0059117 commit bdc56be

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

ZIG_README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Chatbot - Zig Edition
2+
3+
This is a Zig port of the chatbot C implementation. The chatbot uses keyword matching to provide responses based on user input.
4+
5+
## Requirements
6+
7+
- Zig 0.15.2 or later (stable release)
8+
9+
## Building
10+
11+
Build the executable:
12+
13+
```bash
14+
zig build-exe src/main.zig -femit-bin=zig-out/bin/chat
15+
```
16+
17+
Or use the build system:
18+
19+
```bash
20+
zig build
21+
```
22+
23+
This will create the executable in `zig-out/bin/chat`.
24+
25+
## Running
26+
27+
```bash
28+
./zig-out/bin/chat
29+
```
30+
31+
Or via the build system:
32+
33+
```bash
34+
zig build run
35+
```
36+
37+
## Testing
38+
39+
Run all tests:
40+
41+
```bash
42+
zig test src/chatbot.zig
43+
```
44+
45+
Or via the build system:
46+
47+
```bash
48+
zig build test
49+
```
50+
51+
## Architecture
52+
53+
- **chatbot.zig**: Hash table implementation for keyword-response mapping
54+
- **main.zig**: Interactive chatbot CLI
55+
56+
The hash table uses chaining for collision resolution and supports inserting, updating, and retrieving key-value pairs.

0 commit comments

Comments
 (0)