Giter VIP home page Giter VIP logo

tetris's Introduction

Tetris

2020-1 컴퓨팅설계및실험 수업에서 제공된 baseline 코드를 기반으로 주요 함수들을 구현

주요 구현 함수

int CheckToMove() : 블록이 움직일 좌표와 회전 횟수를 이용해 현재 블록이 필드의 해당 위치로 이동 가능한지 여부를 체크.

void DrawChange() : 블록이 이동할 좌표와 회전 횟수, command를 이용해 현재 위치의 블록을 지우고, 필드의 새 위치에 블록을 그림.

void BlockDown() : 현재 블록을 매초마다 한 칸씩 아래로 떨어뜨림. 블록이 더 이상 내려갈 수 없을 경우 블록을 필드에 쌓고 완전히 채워진 line을 지움.

void AddBlockToField() : 현재 위치의 현재 블록을 필드에 쌓음.

int DeleteLine() : 완전히 채워진 line을 찾아 지우고 지운 line의 개수에 대한 점수를 return

void createRankList() : 테트리스 프로그램 시작 시 rank.txt로부터 랭킹 정보를 입력받아 연결 리스트의 형태로 자료를 구축.

void rank() : 정수 2개, x, y(x<=y)를 입력 받고 랭킹 정보(x위 ~ y위)를 화면에 출력.

void writeRankFile() : 추가된 랭킹 정보가 있으면 새 정보를 rank.txt에 저장하고, 추가된 정보가 없으면 그대로 프로그램을 종료.

void newRank() : 게임 종료(game over)시 사용자의 이름을 입력 받고, 사용자의 이름과 점수를 자료 구조에 추가 및 저장.

void DrawShadow() : 현재 위치에 대해 그림자를 필드에 그림.

int recommand() : 사용자에게 좋은 점수를 얻을 수 있는 블록의 위치를 계산. 현재와 다음 블록의 모양, 회전 수, 필드의 상태, 얻을 수 있는 점수 등을 고려.

tetris's People

Contributors

kyj93790 avatar

Stargazers

Eason Wang 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.