Giter Club home page Giter Club logo

algorithmginseng's Introduction

AlgorithmGinseng

산삼 문제 알고리즘

명지 나라의 산삼은 신기한 모양을 갖는다. 산삼은 본체가 4x4로 이루어져있으며 나머지는 뿌리가 존재할 수 있는 위치이다. 뿌리는 본체의 사방향 중 아무데서나 나올 수 있으며 범위 바깥으로 자라지는 않는다.

뿌리가 자라는 규칙은 다음과 같다.

  1. 뿌리의 두께는 한칸씩을 차지한다.
  2. 본체로부터 뻗어나오는 뿌리의 개수는 0~6개 사이의 난수값을 발생시킨다.
  3. 본체와 가까운 첫 뿌리는 무조건 곧게 자란다.
  4. 이후의 뿌리는 사 방향중 한 곳으로 뻗어나간다. 이 또한 난수값으로 처리한다.
  5. 뿌리는 뿌리끼리 서로 같은 칸에 겹치지 않는다.
  6. 뿌리의 길이는 6~9이다. 이 또한 난수값으로 처리한다.
  7. 뿌리의 모양으로 인해 요구하는 뿌리의 개수를 모두 만들 수 없는 경우 이미 만들어진 뿌리만을 출력한다.

규칙에 따라 난수로 발생된 뿌리의 모양을 출력하는 프로그램을 작성하라.

algorithmginseng's People

Contributors

microsongs 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.