-
- 게임 전체를 총괄하는 함수
- round, draw를 제외한 round, player들의 정보, 각라운드의 정보를 담고 있다.
- 다른 함수와 마찬가지로 화살표 함수로 scope를 함수 본문으로 맞춘 함수들을 객체로써 return함으로써 외부에서 해당 메소드를 사용할 수 있게 해주었다.
-
- 라운드 전체를 총괄하는 함수
- draw를 설정하기 위한 laps, 게임판 정보를 담고 있다.
- 게임을 비우는 clearGame 메소드는 gamestart와 cell을 받아서 clear해주고 dialog가 존재한다면 dialog를 처리해주는 result 함수를 리턴한다.
-
- IIFE를 활용하여 즉시 호출되는 함수
- 게임을 설정하고 게임판을 누르면 로직이 발생되도록 한다.
-
- 배열 winRule를 활용하여 게임판이 승리로직과 같은지 검사하는 함수
-
- sign을 받아서 {sign:sign} 객체를 반환하는 함수
- 결과 dialog를 처리하는 함수, 로직에 따라 dialog의 내용을 바꾸고 dialog를 처리한다.
-
- closure를 활용하여 function자체에 private variable을 놓고 이를 접근하는 get property느낌의 function 들을 return 객체에 놓아줌으로써 class처럼 구현되는 js의 특징을 잘 알 수 있었다. (factory function)
- IIFE (Immediately Invoked Function Expression) 를 활용하여 함수의 선언과 함께 호출하는 function을 구현하면서 전역 변수 없이 구현되는 프로그래밍 방식을 알 수 있었다.
- scope의 개념을 숙지하여야 프로젝트를 진행할 수 있었으며 난해했던 기존의 프로그래밍 방식을 많이 개선했던거 같다.
tic-tac-toe's Introduction
tic-tac-toe's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.