# rhythm113/cse115 architecture

> Architecture diagram of the GitHub repository rhythm113/cse115, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rhythm113/cse115
- Repository: https://github.com/rhythm113/cse115

## Overview

This repository contains two independent, fun C programs: a playlist manager and a two-player tic-tac-toe game. The playlist workflow is console selection, playlist/music management or playback, with binary persistence; the game workflow is menu selection, turn-by-turn board updates, and win/draw/cancel detection. Both are implemented in single source files, so the graph separates their meaningful runtime responsibilities without implying they interact. Relationships are evidenced by calls within each excerpt; no shared application or other subsystem is documented.

Main entry points: [`music.c`](https://github.com/rhythm113/cse115/blob/main/music.c) (Playlist operations), [`tt.c`](https://github.com/rhythm113/cse115/blob/main/tt.c) (Turn loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_playlist["Playlist Manager"]
  node_music_app["Music menu<br/>[music.c]"]
  node_playlist_ops["Playlist operations<br/>[music.c]"]
  node_music_ops["Music editing<br/>[music.c]"]
  node_playlist_state["Playlist state<br/>[music.c]"]
  node_binary_store[("Playlist file<br/>[music.c]")]
  node_playback["URL playback<br/>[music.c]"]
end

subgraph group_game["Tic-Tac-Toe"]
  node_game_menu["Game menu<br/>[tt.c]"]
  node_game_loop["Turn loop<br/>[tt.c]"]
  node_board_state["Board state<br/>[tt.c]"]
  node_move_update["Move update<br/>[tt.c]"]
  node_outcome_check["Win/draw checks<br/>[tt.c]"]
  node_board_display["Board display<br/>[tt.c]"]
end

node_user(("Console user"))
node_system_browser["System URL handler"]
node_game_user(("Game player"))

node_user -->|"chooses options"| node_music_app
node_music_app -->|"dispatches commands"| node_playlist_ops
node_music_app -->|"loads at startup"| node_binary_store
node_playlist_ops -->|"updates or lists"| node_playlist_state
node_playlist_ops -->|"saves changes"| node_binary_store
node_playlist_ops -->|"edits or views tracks"| node_music_ops
node_playlist_ops -->|"plays selected track"| node_playback
node_playback -->|"runs URL command"| node_system_browser
node_game_user -->|"chooses game"| node_game_menu
node_game_menu -->|"starts play"| node_game_loop
node_game_loop -->|"initializes board"| node_board_state
node_game_loop -->|"renders board"| node_board_display
node_game_loop -->|"applies move"| node_move_update
node_move_update -->|"writes cell"| node_board_state
node_game_loop -->|"checks outcome"| node_outcome_check
node_outcome_check -->|"reads cells"| node_board_state

click node_music_app "https://github.com/rhythm113/cse115/blob/main/music.c"
click node_playlist_ops "https://github.com/rhythm113/cse115/blob/main/music.c"
click node_music_ops "https://github.com/rhythm113/cse115/blob/main/music.c"
click node_playlist_state "https://github.com/rhythm113/cse115/blob/main/music.c"
click node_binary_store "https://github.com/rhythm113/cse115/blob/main/music.c"
click node_playback "https://github.com/rhythm113/cse115/blob/main/music.c"
click node_game_menu "https://github.com/rhythm113/cse115/blob/main/tt.c"
click node_game_loop "https://github.com/rhythm113/cse115/blob/main/tt.c"
click node_board_state "https://github.com/rhythm113/cse115/blob/main/tt.c"
click node_move_update "https://github.com/rhythm113/cse115/blob/main/tt.c"
click node_outcome_check "https://github.com/rhythm113/cse115/blob/main/tt.c"
click node_board_display "https://github.com/rhythm113/cse115/blob/main/tt.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_music_app,node_playlist_ops,node_music_ops,node_playlist_state,node_binary_store,node_playback,node_user toneBlue
class node_game_menu,node_game_loop,node_board_state,node_move_update,node_outcome_check,node_board_display toneAmber
class node_system_browser toneMint
class node_game_user toneIndigo
```

## Components

### Playlist Manager

- [Music menu](https://github.com/rhythm113/cse115/blob/main/music.c): `music.c`
- [Playlist operations](https://github.com/rhythm113/cse115/blob/main/music.c): `music.c`
- [Music editing](https://github.com/rhythm113/cse115/blob/main/music.c): `music.c`
- [Playlist state](https://github.com/rhythm113/cse115/blob/main/music.c): `music.c`
- [Playlist file](https://github.com/rhythm113/cse115/blob/main/music.c): `music.c`
- [URL playback](https://github.com/rhythm113/cse115/blob/main/music.c): `music.c`

### Tic-Tac-Toe

- [Game menu](https://github.com/rhythm113/cse115/blob/main/tt.c): `tt.c`
- [Turn loop](https://github.com/rhythm113/cse115/blob/main/tt.c): `tt.c`
- [Board state](https://github.com/rhythm113/cse115/blob/main/tt.c): `tt.c`
- [Move update](https://github.com/rhythm113/cse115/blob/main/tt.c): `tt.c`
- [Win/draw checks](https://github.com/rhythm113/cse115/blob/main/tt.c): `tt.c`
- [Board display](https://github.com/rhythm113/cse115/blob/main/tt.c): `tt.c`

### Other components

- **Console user**
- **System URL handler**
- **Game player**

## Connections

- Console user → Music menu: chooses options (evidence: `music.c`)
- Music menu → Playlist operations: dispatches commands (evidence: `music.c`)
- Music menu → Playlist file: loads at startup (evidence: `music.c`)
- Playlist operations → Playlist state: updates or lists (evidence: `music.c`)
- Playlist operations → Playlist file: saves changes (evidence: `music.c`)
- Playlist operations → Music editing: edits or views tracks (evidence: `music.c`)
- Playlist operations → URL playback: plays selected track (evidence: `music.c`)
- URL playback → System URL handler: runs URL command (evidence: `music.c`)
- Game player → Game menu: chooses game (evidence: `tt.c`)
- Game menu → Turn loop: starts play (evidence: `tt.c`)
- Turn loop → Board state: initializes board (evidence: `tt.c`)
- Turn loop → Board display: renders board (evidence: `tt.c`)
- Turn loop → Move update: applies move (evidence: `tt.c`)
- Move update → Board state: writes cell (evidence: `tt.c`)
- Turn loop → Win/draw checks: checks outcome (evidence: `tt.c`)
- Win/draw checks → Board state: reads cells (evidence: `tt.c`)
