diff --git a/api-reference/openapi.json b/api-reference/openapi.json index da5326efc..31a7f11bb 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -1,217 +1,82 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "OpenAPI Plant Store", - "description": "A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification", - "license": { - "name": "MIT" - }, - "version": "1.0.0" - }, - "servers": [ - { - "url": "http://sandbox.mintlify.com" - } - ], - "security": [ - { - "bearerAuth": [] - } - ], - "paths": { - "/plants": { - "get": { - "description": "Returns all plants from the system that the user has access to", - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "The maximum number of results to return", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Plant response", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Plant" - } - } - } - } - }, - "400": { - "description": "Unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - }, - "post": { - "description": "Creates a new plant in the store", - "requestBody": { - "description": "Plant to add to the store", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewPlant" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "plant response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Plant" - } - } - } - }, - "400": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } - }, - "/plants/{id}": { - "delete": { - "description": "Deletes a single plant based on the ID supplied", - "parameters": [ - { - "name": "id", - "in": "path", - "description": "ID of plant to delete", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "204": { - "description": "Plant deleted", - "content": {} - }, - "400": { - "description": "unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } - } - }, - "webhooks": { - "/plant/webhook": { - "post": { - "description": "Information about a new plant added to the store", - "requestBody": { - "description": "Plant added to the store", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NewPlant" - } - } - } - }, - "responses": { - "200": { - "description": "Return a 200 status to indicate that the data was received successfully" - } - } - } - } - }, - "components": { - "schemas": { - "Plant": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "name": { - "description": "The name of the plant", - "type": "string" - }, - "tag": { - "description": "Tag to specify the type", - "type": "string" - } - } - }, - "NewPlant": { - "allOf": [ - { - "$ref": "#/components/schemas/Plant" - }, - { - "required": [ - "id" - ], - "type": "object", - "properties": { - "id": { - "description": "Identification number of the plant", - "type": "integer", - "format": "int64" - } - } - } - ] - }, - "Error": { - "required": [ - "error", - "message" - ], - "type": "object", - "properties": { - "error": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - } - } - } - }, - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer" - } +import org.code.neighborhood.*; + +public class FlagPainter extends Painter { + + public FlagPainter() { + super(); + } + + public void paintSquare(String color) { + paintSquareSide(color); + paintSquareSide(color); + paintSquareSide(color); + paintSquareSide(color); + move(); + turnRight(); + move(); + turnLeft(); + paintWhiteDottedLine(color); + nextRow(); + paintWhiteDottedLine(color); + nextRow(); + paintWhiteDottedLine(color); + nextRow(); + + paintColorDottedLine(color); + nextRow(); + + paintWhiteDottedLine(color); + nextRow(); + } + public void paintSquareSide(String color) { + paint(color); + move(); + paint(color); + move(); + paint(color); + move(); + paint(color); + move(); + paint(color); + move(); + paint(color); + move(); + turnRight(); + } + + public void paintWhiteDottedLine(String color) { + paint("white"); + move(); + paint(color); + move(); + paint("white"); + move(); + paint(color); + move(); + paint("white"); + } + + public void paintColorDottedLine(String color) { + paint(color); + move(); + paint("white"); + move(); + paint(color); + move(); + paint("white"); + move(); + paint(color); + } + + public void nextRow() { + if(isFacingEast()) { + turnRight(); + move(); + turnRight(); + } else { + turnLeft(); + move(); + turnLeft(); } } -} \ No newline at end of file +}