Skip to content

An interactive C# programming tutorial with AI assistant.

License

Notifications You must be signed in to change notification settings

ara3d/AICodingCoach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Coding Coach

An interactive C# programming teaching tool with AI assistant.

image

The AI Coding Coach has been built as a submission for The Microsoft .NET 8 Global Hack.

About

The AI Coding Coach integrates a syntax color text editor, a C# compiler, a drawing canvas, and an interface to GPT-4 API designed to help people learn to code.

Watch the video

Code Example

The compiler automatically compiles C# code as it is entered into the editor. If a class has a Draw metod which accepts a single parameter of type DrawingContext.

For example:

using System.Windows;
using System.Windows.Media;

public class GradientExample
{
 
    public void Draw(DrawingContext context)
    {
        var gradientBrush = new LinearGradientBrush();
        gradientBrush.StartPoint = new Point(0, 0); 
        gradientBrush.EndPoint = new Point(1, 1);   
        gradientBrush.GradientStops.Add(new GradientStop(Colors.Blue, 0.0)); 
        gradientBrush.GradientStops.Add(new GradientStop(Colors.Red, 1.0));  
        context.DrawRectangle(gradientBrush, null, new Rect(50, 50, 300, 200));
    }
}

Prompts

The GPT Chat API is provided with a system prompt to guide it to produce code that can be executed by the compiler.

If you right click in the prompt window, the context menu provides a list of predefined prompts you can choose from.

If you highlight text in the code editor, you can right click and choose from the context menu an option to ask Chat GPT to explain the code for you.

Building the Code

Compiling the source code for AICodingCoach as-is requires that you first clone the Ara3D repository so that both repositories share the same parent folder. If you clone the Ara3D repository into a different location you will have to update the AICodingCoach project manually so that it can find the project references.

Inspiration and References

About

An interactive C# programming tutorial with AI assistant.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages