From 402a8d76982d1da3cd50f871b8f4b5ef72f6e582 Mon Sep 17 00:00:00 2001 From: Andriy Date: Sun, 11 May 2025 00:08:40 +0200 Subject: [PATCH] Finalize merge: keep local Karel-Simulator files in Exam/ --- Dockerfile | 15 - disable-maintenance.sh | 6 - docker-compose.yml | 14 - enable-maintenance.sh | 6 - index.html | 849 ----------------------------------------- maintenance/index.html | 10 - manual.html | 106 ----- prepare-app.sh | 9 - remove-app.sh | 24 -- start-app.sh | 20 - stop-app.sh | 5 - 11 files changed, 1064 deletions(-) delete mode 100644 Dockerfile delete mode 100755 disable-maintenance.sh delete mode 100644 docker-compose.yml delete mode 100755 enable-maintenance.sh delete mode 100755 index.html delete mode 100644 maintenance/index.html delete mode 100755 manual.html delete mode 100755 prepare-app.sh delete mode 100755 remove-app.sh delete mode 100755 start-app.sh delete mode 100755 stop-app.sh diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4e005b9..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -# Dockerfile -FROM nginx:alpine - -# Remove default content -RUN rm -rf /usr/share/nginx/html/* - -# Copy your simulator files -COPY . /usr/share/nginx/html - -# Expose port 80 -EXPOSE 80 - -# Run Nginx in foreground -CMD ["nginx", "-g", "daemon off;"] - diff --git a/disable-maintenance.sh b/disable-maintenance.sh deleted file mode 100755 index 12e80ef..0000000 --- a/disable-maintenance.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -e -# deploy the real site back -netlify deploy --prod --dir=. \ - --message="✅ Live site ON" - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index a04527d..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -services: - simulator: - build: . - image: karel-simulator - container_name: karel-simulator - ports: - - "8080:80" - restart: unless-stopped - - redis: - image: redis:alpine - container_name: karel-redis - restart: unless-stopped - diff --git a/enable-maintenance.sh b/enable-maintenance.sh deleted file mode 100755 index 2269861..0000000 --- a/enable-maintenance.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -e -# deploy the maintenance folder -netlify deploy --prod --dir=maintenance \ - --message="⚙️ Maintenance page ON" - diff --git a/index.html b/index.html deleted file mode 100755 index d1f9838..0000000 --- a/index.html +++ /dev/null @@ -1,849 +0,0 @@ - - - - - Karel Simulator - - - -

Karel Simulator

- - -
-
-

- Write your Karel program below. Parentheses & semicolons mandatory. - If you’re ever unsure how to use the Simulator, - - consult the manual - . -

- - - - -

Console Output:

-
-

Upload Map File:

- - -
- -
-

Karel Map:

-
-
-
-
- - - - - - - diff --git a/maintenance/index.html b/maintenance/index.html deleted file mode 100644 index 222a280..0000000 --- a/maintenance/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -Down for Maintenance - -

⚙️ Site Under Maintenance

-

We’ll be back shortly. Thank you for your patience!

- - - diff --git a/manual.html b/manual.html deleted file mode 100755 index ae50aef..0000000 --- a/manual.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - Karel Simulator — User Manual - - - -

Karel the Robot – Quick-Start User Guide

- -

1. What Is Karel?

-

- Karel lives in a 2-D grid (“world”) of square cells. - He can face North/East/South/West, move one cell at a time, - pick up or put down “beepers,” and detect walls. -

- -

2. Simulator Interface

- - -

3. Syntax Essentials

- - -

4. Built-in Commands

-

Movement

- - - - -
CommandEffect
move()Step forward if no wall ahead.
turnLeft()Rotate 90° counter-clockwise.
- -

Beeper Handling

- - - - -
CommandEffect
pickBeeper()Pick one beeper from current cell.
putBeeper()Place one beeper into current cell.
- -

Sensors & Conditions

- - - - - - - - - - - - - - -
ConditionTrue When…
frontIsClear()No wall immediately in front.
frontIsBlocked()Wall immediately in front.
leftIsClear()No wall on Karel’s left.
leftIsBlocked()Wall on Karel’s left.
rightIsClear()No wall on Karel’s right.
rightIsBlocked()Wall on Karel’s right.
nextToABeeper()One or more beepers in this cell.
notNextToABeeper()No beepers in this cell.
facingNorth(), facingEast(), …Karel’s orientation matches the named direction.
anyBeepersInBeeperBag()Bag contains ≥ 1 beeper.
noBeepersInBeeperBag()Bag is empty.
- -

5. Example

-
while ( notNextToABeeper() ) {
-  move();
-}
-pickBeeper();
-turnLeft();
-move();
-putBeeper();
- -

6. Tips

- - -

← Back to Simulator

- - diff --git a/prepare-app.sh b/prepare-app.sh deleted file mode 100755 index 0c7df7c..0000000 --- a/prepare-app.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Name for the Docker image -IMAGE_NAME="karel-simulator" - -echo "🔨 Building Docker image '$IMAGE_NAME'..." -docker build -t "${IMAGE_NAME}" . -echo "✅ Image '${IMAGE_NAME}' built." diff --git a/remove-app.sh b/remove-app.sh deleted file mode 100755 index d0280dc..0000000 --- a/remove-app.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -e - -IMAGE_NAME="karel-simulator" -CONTAINER_NAME="karel-simulator" - -# Stop & remove the container if it exists -if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}\$"; then - echo "🗑️ Removing container '${CONTAINER_NAME}'..." - docker rm -f "${CONTAINER_NAME}" - echo "✅ Container removed." -else - echo "ℹ️ No container named '${CONTAINER_NAME}' to remove." -fi - -# Remove the image if it exists -if docker images -q "${IMAGE_NAME}" >/dev/null; then - echo "🗑️ Removing image '${IMAGE_NAME}'..." - docker rmi "${IMAGE_NAME}" - echo "✅ Image removed." -else - echo "ℹ️ No image named '${IMAGE_NAME}' to remove." -fi - diff --git a/start-app.sh b/start-app.sh deleted file mode 100755 index b0c7d93..0000000 --- a/start-app.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -e - -# 1) Clean up any existing containers (manual or compose) -for NAME in karel-simulator karel-redis; do - if docker ps -a --format '{{.Names}}' | grep -q "^${NAME}\$"; then - echo "🛑 Removing existing container '${NAME}'..." - docker rm -f "${NAME}" >/dev/null 2>&1 || true - fi -done - -# 2) (Re)start both services in detached mode -echo "🚀 Starting multi-container application..." -docker compose up -d - -# 3) Status -echo "✅ All containers are up:" -docker ps --filter "name=karel" --format " • {{.Names}} ({{.Image}}) → {{.Ports}}" -echo "" -echo "🌐 Simulator: http://localhost:8080/" diff --git a/stop-app.sh b/stop-app.sh deleted file mode 100755 index 9d4cb3a..0000000 --- a/stop-app.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -e -echo "⏹ Shutting down all containers..." -docker-compose down -echo "✅ Stopped."