Skip to content

snsie/CAI-5724-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAI-5724 Demo Workspace

An instructional sandbox demonstrating how to use GitHub Copilot across multiple languages & contexts: Python (notebook), Lua (LÖVE2D game), and guidance for scaffolding a small React medical app.

📁 What's in This Repo

File Purpose
copilot_lesson.ipynb Interactive lesson: concepts, ethics, shortcuts, and hands‑on Copilot exercises (BMI calculator, class design, LÖVE2D + React prompts).
main.lua Entry point for the LÖVE2D mini game exercise (you'll iteratively build or replace contents using Copilot Chat).
README.md You are here—overview, setup, and usage instructions.

🧠 Learning Goals

Using this workspace you will:

  1. Understand what GitHub Copilot & Copilot Chat can (and cannot) do.
  2. Practice comment‑to‑code and inline chat driven development in Python.
  3. Build / iterate on a simple LÖVE2D (Lua) game loop with AI assistance.
  4. Plan a basic React “medical records” interface (prompts & workflow guidance).
  5. Reflect on ethical, licensing, and integrity considerations when using AI.

📝 Notebook Lesson

Open copilot_lesson.ipynb inside VS Code / Codespaces. It walks you through:

  • Copilot basics & activation
  • Keyboard shortcuts & chat slash commands (/explain, /fix, /tests, /doc, /optimize)
  • Responsible use & academic integrity reminders
  • Guided Python exercises (BMI, dosage function, patient record class)
  • Prompt patterns for iterative refinement
  • Exercises for Lua (game) and React (medical app UI)

Tip: Use inline chat (Ctrl+I) right inside a code cell or file to request specific functionality without leaving your context.

🏃 Running the LÖVE2D Demo (Lua)

This project uses LÖVE—a lightweight 2D game framework.

Inside the dev container, run:

DISPLAY=:0 love .

Why DISPLAY=:0? The container needs an X display target. In Codespaces with a GUI / forwarded display extension this directs LÖVE's window to the expected display. If you're running locally outside the container you can usually just run:

love .

Iterative Workflow

  1. Open main.lua.
  2. Clear or simplify existing content.
  3. Ask Copilot Chat: “Create a LÖVE2D game with a bouncing ball that changes color on edge collisions.”
  4. Run the command above to test.
  5. Iterate: add player control, scoring, particles, etc., by prompting Chat (e.g., “Add arrow key control” / “Add a trail effect”).

🧪 Python Exercises

In the notebook you’ll:

  • Implement calculate_bmi and a dosage calculator.
  • Write tests (prompt Copilot: “/tests generate pytest tests for this function”).
  • Design a PatientRecords class (ask for validation rules, stats, or docstrings).

Suggested Inline Chat Prompts

Try these while your cursor is in a code cell:

  • “Add input validation & raise ValueError for invalid height.”
  • “Refactor to a dataclass.”
  • “Generate edge case tests.”

🌐 React Medical App (Concept Phase Here)

The notebook guides you to start a new React app (outside this minimal repo). Suggested flow:

  1. Ask: “Scaffold a React app for a simple patient dashboard (no backend).”
  2. Follow up: “Add a component to filter patients by condition and show basic stats.”
  3. Ask for accessibility improvements: “Ensure ARIA roles and keyboard navigation.”

🤖 Effective Copilot Usage

Scenario Strategy
Unsure of API Write a high‑level comment, pause for suggestion.
Need refactor Select code → /optimize or ask “Simplify and explain.”
Understanding unfamiliar code Highlight → /explain
Generate tests Select function → /tests
Fix an error Select block / file → /fix
Multi‑file change reasoning Use @workspace + describe the goal.

🔐 Ethics & Integrity Highlights

  • Review every suggestion—don’t blindly accept.
  • Avoid pasting sensitive or proprietary data into prompts.
  • Cite Copilot usage if required by course policy.
  • Run security & logic reviews (especially for medical / regulated contexts).

🧩 Project Structure (Current Minimal Form)

.
├── copilot_lesson.ipynb   # Guided lesson & exercises
├── main.lua               # Lua game entry point (build via Copilot)
└── README.md              # Documentation

✅ Suggested Next Enhancements

  • Add a requirements.txt if you formalize Python dependencies.
  • Create a tests/ folder and persist generated pytest tests.
  • Add a starter main.lua template with comments for each LÖVE callback.
  • Scaffold a separate React subfolder (/react-app) once ready.

❓ Troubleshooting

Issue Check
No Copilot suggestions Is extension enabled / signed in? Rate limit?
LÖVE window not appearing DISPLAY variable / GUI forwarding support
Chat can’t reference files Ensure they are saved & opened; use @workspace.
Repetitive suggestions Rephrase prompt: include intent + constraints.

📜 License / Attribution

No explicit license included yet—add one (e.g., MIT) before distributing. Remember: you are responsible for reviewing and validating all AI‑assisted code.


Happy experimenting! Try stretching each exercise: add scoring to the game, persist patient data, or benchmark alternative implementations suggested by Copilot.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published