1
1
[ ![ Twitter URL] ( https://img.shields.io/twitter/url/https/twitter.com/deanthecoder.svg?style=social&label=Follow%20%40deanthecoder )] ( https://twitter.com/deanthecoder )
2
2
# CodeIngest
3
- ** CodeIngest** is a cross-platform C# CLI tool that recursively scans a directory of source files, filters out noise (comments, using statements, namespaces), and generates a flattened source dump designed for GPT code review or large-scale source inspection.
3
+ ** CodeIngest** is a cross-platform C# tool that recursively scans a directory of source files, filters out noise (comments, using statements, namespaces), and generates a flattened source dump designed for GPT code review or large-scale source inspection.
4
+ ![ CodeIngest Screenshot] ( img/app.png )
4
5
5
6
## Features
6
7
- Cross-platform (.NET)
8
+ - Command-line and UI variants.
7
9
- Strips comments, ` using ` directives, and ` namespace ` blocks
8
10
- Outputs a single readable output file with the following features:
9
- - File headers
10
- - Line numbers
11
- - Cleaned source code
11
+ - File headers
12
+ - Line numbers
13
+ - Cleaned source code
12
14
- Skips generated and irrelevant files (e.g. ` .designer.cs ` , ` bin ` , ` obj ` , ` .resx ` , etc.)
13
15
14
- ## Usage
16
+ ## Command Line Usage
15
17
```
16
18
CodeIngest <directory> [<directory> ...] [*.ext1;*.ext2] <output.code>
17
19
```
@@ -25,61 +27,61 @@ CodeIngest *.cs;*.cpp SourceDump.code
25
27
26
28
## Example Output
27
29
``` csharp
28
- // CodeIngest Source Dump - A CLI tool that merges and processes code files for GPT reviews.
30
+ // CodeIngest Source Dump- A CLI tool that merges and processes code files for GPT reviews.
29
31
// Notes: Some code content may have been removed.
30
32
// File: GameState.cs
31
- 20 | public class GameState : IAiGameState
33
+ 20 | public class GameState : IAiGameState
32
34
21|{
33
35
22|private readonly Vector2 [] m_bats ;
34
36
23|private readonly Vector2 m_ballPosition ;
35
37
24|private readonly Vector2 m_ballVelocity ;
36
38
25|private readonly int m_arenaWidth ;
37
39
26|private readonly int m_arenaHeight ;
38
- 28|public GameState (Vector2 [] bats , Vector2 ballPosition , Vector2 ballVelocity , int arenaWidth , int arenaHeight )
40
+ 28|public GameState (Vector2 [] bats ,Vector2 ballPosition ,Vector2 ballVelocity ,int arenaWidth ,int arenaHeight )
39
41
29|{
40
- 30 | m_bats = bats ;
41
- 31 | m_ballPosition = ballPosition ;
42
- 32 | m_ballVelocity = ballVelocity ;
43
- 33 | m_arenaWidth = arenaWidth ;
44
- 34 | m_arenaHeight = arenaHeight ;
42
+ 30 | m_bats = bats ;
43
+ 31 | m_ballPosition = ballPosition ;
44
+ 32 | m_ballVelocity = ballVelocity ;
45
+ 33 | m_arenaWidth = arenaWidth ;
46
+ 34 | m_arenaHeight = arenaHeight ;
45
47
35 | }
46
48
37|public double [] ToInputVector ()
47
49
38|{
48
- 39 | var inputVector = new double [Brain .BrainInputCount ];
49
- 42 | inputVector [0 ] = m_bats [0 ].Y / m_arenaHeight * 2 . 0 f - 1 . 0 f ;
50
- 43 | inputVector [1 ] = m_bats [1 ].Y / m_arenaHeight * 2 . 0 f - 1 . 0 f ;
51
- 45 | inputVector [2 ] = (m_bats [0 ].Y - m_ballPosition .Y ) / m_arenaHeight * 2 . 0 f ;
52
- 46 | inputVector [3 ] = (m_bats [1 ].Y - m_ballPosition .Y ) / m_arenaHeight * 2 . 0 f ;
53
- 49 | inputVector [4 ] = m_ballPosition .X / m_arenaWidth * 2 . 0 f - 1 . 0 f ;
54
- 50 | inputVector [5 ] = m_ballPosition .Y / m_arenaHeight * 2 . 0 f - 1 . 0 f ;
55
- 51 | inputVector [6 ] = m_ballVelocity .X .Clamp (- 1 . 0 f , 1 . 0 f );
56
- 52 | inputVector [7 ] = m_ballVelocity .Y .Clamp (- 1 . 0 f , 1 . 0 f );
50
+ 39 | var inputVector = new double [Brain .BrainInputCount ];
51
+ 42 | inputVector [0 ]= m_bats [0 ].Y / m_arenaHeight * 2 . 0 f - 1 . 0 f ;
52
+ 43 | inputVector [1 ]= m_bats [1 ].Y / m_arenaHeight * 2 . 0 f - 1 . 0 f ;
53
+ 45 | inputVector [2 ]= (m_bats [0 ].Y - m_ballPosition .Y )/ m_arenaHeight * 2 . 0 f ;
54
+ 46 | inputVector [3 ]= (m_bats [1 ].Y - m_ballPosition .Y )/ m_arenaHeight * 2 . 0 f ;
55
+ 49 | inputVector [4 ]= m_ballPosition .X / m_arenaWidth * 2 . 0 f - 1 . 0 f ;
56
+ 50 | inputVector [5 ]= m_ballPosition .Y / m_arenaHeight * 2 . 0 f - 1 . 0 f ;
57
+ 51 | inputVector [6 ]= m_ballVelocity .X .Clamp (- 1 . 0 f ,1 . 0 f );
58
+ 52 | inputVector [7 ]= m_ballVelocity .Y .Clamp (- 1 . 0 f ,1 . 0 f );
57
59
54 | return inputVector ;
58
60
55 | }
59
61
56|}
60
62
// File: Brain.cs
61
- 18 | public class Brain : AiBrainBase
63
+ 18 | public class Brain : AiBrainBase
62
64
19|{
63
- 20|public const int BrainInputCount = 8 ;
64
- 22|public Brain () : base (BrainInputCount , [16 ], 4 )
65
+ 20|public const int BrainInputCount = 8 ;
66
+ 22|public Brain (): base (BrainInputCount ,[16 ],4 )
65
67
23|{
66
68
24 | }
67
- 26|private Brain (Brain brain ) : base (brain )
69
+ 26|private Brain (Brain brain ): base (brain )
68
70
27|{
69
71
28 | }
70
- 29|public (Direction LeftBat , Direction RightBat ) ChooseMoves (IAiGameState state )
72
+ 29|public (Direction LeftBat ,Direction RightBat ) ChooseMoves (IAiGameState state )
71
73
30|{
72
- 31 | var outputs = GetOutputs (state );
73
- 33 | var leftBatDirection = Direction .Left ;
74
- 34 | var diff = outputs [0 ] - outputs [1 ];
75
- 35 | if (Math .Abs (diff ) > 0 . 2 )
76
- 36 | leftBatDirection = diff > 0 ? Direction .Up : Direction .Down ;
77
- 38 | var rightBatDirection = Direction .Left ;
78
- 39 | diff = outputs [2 ] - outputs [3 ];
79
- 40 | if (Math .Abs (diff ) > 0 . 2 )
80
- 41 | rightBatDirection = diff > 0 ? Direction .Up : Direction .Down ;
81
- 43 | return (leftBatDirection , rightBatDirection );
74
+ 31 | var outputs = GetOutputs (state );
75
+ 33 | var leftBatDirection = Direction .Left ;
76
+ 34 | var diff = outputs [0 ]- outputs [1 ];
77
+ 35 | if (Math .Abs (diff )> 0 . 2 )
78
+ 36 | leftBatDirection = diff > 0 ? Direction .Up : Direction .Down ;
79
+ 38 | var rightBatDirection = Direction .Left ;
80
+ 39 | diff = outputs [2 ]- outputs [3 ];
81
+ 40 | if (Math .Abs (diff )> 0 . 2 )
82
+ 41 | rightBatDirection = diff > 0 ? Direction .Up : Direction .Down ;
83
+ 43 | return (leftBatDirection ,rightBatDirection );
82
84
44 | }
83
- 46|public override AiBrainBase Clone () => new Brain (this );
85
+ 46|public override AiBrainBase Clone ()=> new Brain (this );
84
86
47|}
85
87
```
0 commit comments