Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.63 KB

README.md

File metadata and controls

45 lines (28 loc) · 1.63 KB

Snowflake generator

This small project was for COMP1202 Programming 1 at the University of Southampton end of Christmas term challenge.

It does what it says on the tin and generates snowflakes in SVG form.

How does it work

Lots and lots of trig.

  1. Generates a random number of sub branches and a random length for each sub branch
  2. Generates random stroke sizes for the main branches and a random stroke for each sub branch
  3. Uses lots of trigonometry to draw out all of the lines
  4. Actually draws each line in relation to the SVG

Inspiration

This snowflake generator served as my initial inspiration and you can probably see the similarities. I tried looking for the source code but couldn't find anything so I ended up just using it for design inspiration. Their solution was quite basic so I developed on it further.

This codegolf solution generates snowflakes using only 190 bytes of HTML and JavaScript which was very impressive.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository