Giter Club home page Giter Club logo

ios-baseball's Introduction

ios-baseball

숫자야구 프로젝트 저장소입니다.

함수


computerNumber(): 컴퓨터의 임의의 수 3개를 만들어 주는 랜덤함수

userNumber(): 사용자 임의의 수 3개를 만들어 주는 랜덤함수

comparison(): computerNumber(), userNumber() 두개의 함수를 비교하여 스트라이크와 볼을 나타내주는 함수

startGame(): 9번 반복하며 3스트라이크가 나오면 사용자 승리, 9번 반복이 다되면 컴퓨터승리를 반환하는 게임 시작함수

문제점

값이 출력할때 임의의 수가 배열에 감싸져서 출력된다

해결방법

compactMap 라는 고차함수를 써서 해결했다

실행 화면

순서도

ios-baseball's People

Contributors

moonsoungjin avatar tacocat-tastycode 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.