Code Monkey home page Code Monkey logo

draw-this's Introduction

draw-this

https://media.giphy.com/media/d31vTpVi1LAcDvdm/giphy.gif

Create a program that takes in commands to draw different figures.

First Version

Your program will take a command to draw a "row", (it will be a <p> tag) with the number of columns you want to draw.

Start by outputting a 🍍for each column.

Example:

You input: 3.

Your program draws:

🍍🍍🍍

Your HTML would look like this:

<p>🍍🍍🍍</p>

You input 2.

Your program draws a new row, adding to what's already there:

🍍🍍🍍
🍍🍍

You can type clear to clear the elements out of the DOM.

Second Version

When you type clear 2 it clears the 2nd row. (Note: you will need .split to get the 2 arguments out of this input string)

further

Add the ability to add multiple rows at a time.

Example:

You can type 2 2.

Your program will make a shape like this:

🍍🍍
🍍🍍

The HTML should look like this:

<p>🍍🍍</p>
<p>🍍🍍</p>

further

When your program first runs, ask the user what character or emoji that your program will use to draw, for all commands.

further

Add the ability to draw triangles.

Type triangle 3 would draw:

🍍
🍍🍍
🍍🍍🍍

further

Create a reverse triangle:

Type rtriangle 3 would draw:

    🍍
  🍍🍍
🍍🍍🍍

Note: you will need the HTML entity &nbsp; to create spaces. See: https://www.w3schools.com/html/html_entities.asp

further

Create a program that draws on a 4 x 4 area.

Create a "cursor" that keeps track of where to draw from.

When you type down 2 the program draws in that direction. Start with just the commands up, down, left, right.

Given your cursor is at: 0,1

⬜c ⬜⬜
⬜⬜⬜⬜
⬜⬜⬜⬜
⬜⬜⬜⬜

You type: down 2

⬜🍍⬜⬜
⬜🍍⬜⬜
⬜⬜⬜⬜
⬜⬜⬜⬜

further

Check the user's input to make sure they are not drawing out of the drawing area.

further

At the beggining of the program, tell the program how large the drawing field should be. Make it a single number (i.e., square)

further

Add the ability to make equilateral triangles and upsidedown equilateral triangles.

Type: etriangle 3

  🍍
 🍍🍍
🍍🍍🍍

Type: eutriangle 3

🍍🍍🍍
 🍍🍍
  🍍

draw-this's People

Contributors

awongh avatar emijay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.