Mehmet Bener

Home

Student at Hisar School | Researcher at ideaLab
Hi! My name is Mehmet Bener, I’m a high school sophomore studying at Hisar Highschool and this is my AP Computer Science Principles website.

AP CS Principles Projects

X-O-X Game on Scratch
Scratch Project Link
Github Source Code
Here's a short demo video of my Scratch X-O-X game:
X-O-X UI using Swift
Github Source Code
Here's the UI design for my Swift-based X-O-X UI:
X-O-X Swift UI Design
Calculator using Swift
Github Source Code
Here's a short demo video of the calculator:
Clock App using Swift
V1 Github Source Code
V2 Github Source Code
V3 Github Source Code
V5 Github Source Code
Demo of V1:
Demo of V2:
Demo of V3:
Demo of V5:
Van Gogh Portrait using Swift
Github Source Code
Here's a photo of the design:
Van Gogh Portrait

Big Ideas

Big Idea 1 — Creative Development (CRD)

AP Exam Weighting: 10–13%

Creative Development focuses on how programs are planned, built, and improved with a user focus and feedback cycles. It emphasizes collaboration, program purpose and behavior, iterative/incremental design, documentation and acknowledgement of others’ work, and systematic testing/debugging. :contentReference[oaicite:0]{index=0}

  • Collaboration (CRD-1): Diverse teams and effective interpersonal skills (communication, consensus, conflict resolution, negotiation) improve innovations and reduce bias.
  • Program Function & Purpose (CRD-2.A–D): Programs solve problems or express interests; understand inputs (incl. events), outputs, and behavior across a range of situations.
  • Design & Development (CRD-2.E–H): Use iterative + incremental processes (investigate → design → prototype → test); plan UIs, gather user feedback, document code and acknowledge external sources.
  • Identifying & Correcting Errors (CRD-2.I–J): Find and fix logic, syntax, run-time, and overflow errors using defined test inputs (including edge cases), tracing, visualizations, and debuggers.
Essential Questions
  • How has collaboration improved your project?
  • How will you plan, collect feedback, and refine your program?

100 Days of SwiftUI — Days 1, 2, 5, 6

Super-condensed notes + one mini example per day.

Day 1 — Variables, Constants, Strings, Numbers

  • Focus: var vs let, strings, integers, doubles.
  • Tip: Prefer let until you need mutation.
  • Example:
// Day 1
    let name = "Mehmet"
    var score = 0
    score += 10
    let summary = "Hi \(name)! Score: \(score)"

Day 2 — Booleans & String Interpolation (Checkpoint 1)

  • Focus: Bool, comparisons, interpolation.
  • Tip: Keep conditions readable; avoid nesting when possible.
  • Example:
// Day 2
    let passed = score >= 10
    let status = passed ? "✅ Passed" : "❌ Try again"
    print("Result: \(status)")

Day 5 — If, Switch, Ternary

  • Focus: Branching with if, switch, and ?:.
  • Tip: Use switch for discrete cases; keep if for ranges/booleans.
  • Example:
// Day 5
    let grade = 88
    let band: String
    switch grade {
    case 90...100: band = "A"
    case 80..<90:  band = "B"
    default:       band = "C or below"
    }

Day 6 — Loops (for/while), break & continue (Checkpoint 3)

  • Focus: Repetition patterns; exiting/skipping work safely.
  • Tip: Prefer for over while unless conditions evolve inside.
  • Example:
// Day 6
    var total = 0
    for n in 1...10 {
      if n == 5 { continue }   // skip 5
      total += n
    }
    print(total) // 1+2+3+4+6+7+8+9+10
Documentation
X-O-X Game Using Scratch
Scratch Project Link
Github Source Code
Video
Overview
This Scratch version uses one button sprite per square and two overlay sprites (X and O) for that square. A small variable controls which symbol is shown.
Key Idea
Each square has a variable named like “my variable”. Values mean: 0 = empty, 1 = show X, 2 = show O.
How It Works
On green flag, set the squares variable to 0.
When the square's button sprite is clicked, if the value is 0 or 2, set it to 1; otherwise set it to 2.
The X sprite for that cell runs forever: if the variable = 1 then show, else hide.
The O sprite for that cell runs forever: if the variable = 2 then show, else hide.
This pattern is repeated for all nine squares.
Limitations Right Now
No turn order; players can flip a cell back and forth.
No win or draw detection.
No board reset button.
Each cell is independent. There is no shared game state.
X-O-X UI Using Swift Playground
Github Source Code
Video
Overview
This SwiftUI Playground builds a simple layout for a tic-tac-toe board. It positions nine blue squares and overlays X's and O's.
How It Works
Everything is inside a ZStack so boxes and texts can overlap. Each rectangle is a blue square made with Rectangle().frame(width:120,height:120). Text views for X or O are layered above the squares.
Boxes are placed using .offset(...) with x and y values of −140, 0, or 140 to form a 3×3 grid around the center.
Limitations Right Now
No tap handling or turns.
No data storage to store X/O state.
No win/draw detection or reset.
Fixed sizes and offsets; not adaptive to different screens.
Next Steps
Replace manual offsets with an adaptive grid.
Store X/O per cell.
Implement placing moves.
Write a function to check winning and losing and a button to reset the board.
SwiftUI Calculator App
Github Source Code
Overview
This project is a simple SwiftUI-based calculator that takes two number inputs and performs four basic operations: addition, subtraction, multiplication, and division. It displays all results instantly.
Key Idea
The app converts the two input strings into Double values, performs calculations, and displays the results in real time inside styled text fields and labels.
How It Works
The app uses @State properties to store the two user inputs.
The strings are converted into double type variables.
It calculates addition, subtraction, multiplication, and division results immediately.
A ZStack and VStack are used to organize the UI with a clean look.
Division by zero is safely handled by displaying “—” instead of an error.
Issues I Faced
I had trouble with a "Partial Double" type when i tried to perform calculations on my variables already converted to Double's.
I researched the issue and found a solution where "?? 0" is used while converting the String type to a Double.
Limitations Right Now
No dedicated "Calculate" button; results update instantly but lack manual control.
No ability to perform chained operations or store previous results.
No history or memory functionality.
Next Steps
Add a "Calculate" button for better control.
Improve input validation to prevent invalid entries.
Add a clear/reset button to reset fields.
Personal Portfolio Website
Github Source Code
Overview
This project is a single-page personal portfolio website built using HTML, CSS, and JavaScript. It showcases my profile, projects, big ideas, and detailed documentation.
Key Idea
The website uses a hashes to display different sections (Home, Projects, Big Ideas, Documentation) without reloading the page. Each section is a hidden div which is dynamically revealed based on the current URL hash.
How It Works
Navigation links in the header update the URL hash (#projects, #documentation).
A small JavaScript router listens for hash changes and displays the relevant page by toggling display styles.
The Projects section embeds demo videos and screenshots stored in the /assets folder.
The Documentation section explains the implementation details of my AP CS Principles projects.
Features
Hash-based navigation. Single-page app experience without frameworks.
Embedded videos & images. Uses video and img tags for demos.
Responsive layout. Automatically adjusts to mobile and desktop screens.
Dynamic page titles. Updates based on the active section for better SEO.
Issues I Faced
Videos and images didn't load at the start because i didn't add a slash to the start of the href links.
Clock App using Swift
Github Source Code
Overview
This project is a digital clock made using Swift. You can increase and decrease the minutes and hours and you will see the time you set on the clock.
Key Idea
Uses angle calculations based on hour and minute variable values. Uses these angles to set the angle of the clock to show the time set by the user.
How It Works
There are 4 buttons that are: "+ hour", "- hour", "+ minute" and "- minute".
These buttons change the values of the hour and minute variables.
The minute and variables change the angle variables.
For 1 hour the hour rectangle rotates 30 degrees, for 1 minute the hour rectangle rotates 1/2 degrees.
For 1 minute the minute rectangle rotates 6 degrees, for 1 hour the minute rectangle doesn't rotate.