자바스크립트는 프로토타입 기반의 객체 지향 프로그래밍 언어이다. 여기서 객체 지향 프로그래밍이란, 코드를 객체 단위로 구조화하여 관련된 데이터와 기능을 함께 묶어서 사용하는 프로그래밍 패러다임을 의미한다. 객체 생성과 속성 객체는 속성과 메서드를 포함하며, 프로토타입은 객체의 상속을 위해 사용된다. 자바스크립트에서 객체는 중괄호({})로 감싸서 생성하며, 속성과 메서드를 포함할 수 있다. 속성은 객체 내부의 변수와 같은 역할을 하며, 메서드는 객체 내부의 함수와 같은 역할을 한다. // 객체 생성 let person = { name: "Isaac", age: 23, sayHello: function() { console.log("Hello!"); } }; // 객체 속성 접근 console.log(per..
Functions A function is a code block that performs a series of tasks. Understanding JavaScript functions and scope allows you to effectively manage the scope of variables and write modularized code. function functionName(parameter1, parameter2, ...) { // Function body // ... return result; } In the code above, functionName is the name of the function, and parameter1, parameter2, etc., are the pa..
I wanted to create a game with a classic concept and, as I transitioned from Visual Studio to VSCode, I became familiar with the development environment and decided to start a game development project to practice and improve my skills. It took me about 1 to 2 weeks to complete the game, but I felt a bit limited in utilizing various features of the SDL2 library since I wasn't as familiar with imp..
함수 함수는 일련의 작업을 수행하는 코드 블록이다. 자바스크립트 함수와 스코프의 개념을 이해하면 변수의 유효 범위를 효과적으로 관리할 수 있고, 모듈화된 코드를 작성할 수 있다. function functionName(parameter1, parameter2, ...) { // 함수 내용 // ... return result; } 위의 코드에서 functionName은 함수의 이름이며, parameter1, parameter2 등은 함수에 전달되는 매개변수이다. 함수 내용은 중괄호({}) 안에 작성되며, 함수가 반환해야 하는 결과는 return 키워드를 사용하여 지정한다. 함수의 스코프 스코프는 변수 및 함수의 유효 범위를 나타낸다. 자바스크립트에서는 함수에 따라 스코프가 결정되며, 스코프는 전역 스코프..
고전 컨셉의 게임을 만들고 싶었는데, Visual Studio에서 VSCode로 넘어오면서 개발 환경에도 익숙해지고 감도 익힐 겸 게임 개발 프로젝트를 시작하게 되었다. 게임 완성까지는 약 1주에서 2주 정도의 시간이 걸렸는데, VSCode에서 SDL2 라이브러리를 불러오는 것이 익숙하지 않아 다양한 기능을 사용하지 못해서 아쉽다. 이 프로젝트는 여기서 마치고, 다음에 게임을 개발하게 될 경우 다른 언어로 시도해보려고 한다. A Word of Heart의 인트로 화면이다. 1985년작 고전 비디오 게임 King's Valley의 인트로를 레퍼런스로 제작하였다. 게임을 만들면서 하나님이 힘을 주셔서 Powered by Jesus Christ라고 썼다. :D Space Key를 누를 경우 다음 화면으로 넘어..
정규 표현식은 문자열에서 패턴을 찾고, 특정한 규칙에 맞는 문자열을 매칭하고 추출하는 데 사용되는 도구이며, 파이썬은 정규 표현식을 처리하기 위해 re 모듈을 제공하고 있다. 정규 표현식의 기본 문법 정규 표현식은 패턴을 표현하기 위한 문자열이다. 다양한 메타문자와 특수 시퀀스를 사용하여 패턴을 정의할 수 있다. 패턴을 표현한 후, 이를 활용하여 문자열에서 패턴을 검색하거나 추출할 수 있으며, 주요한 메타문자와 특수 시퀀스는 다음과 같다. . : 임의의 한 문자와 매치 ^ : 문자열의 시작과 매치 $ : 문자열의 끝과 매치 * : 바로 앞에 있는 문자가 0번 이상 반복되는 패턴과 매치 + : 바로 앞에 있는 문자가 1번 이상 반복되는 패턴과 매치 ? : 바로 앞에 있는 문자가 0번 또는 1번 나타나는 패..
Deadline is a game inspired by the traditional Hangman game, where the term "deadline" refers to the due date. In this game, the goal is to guess an English word by guessing its individual letters, similar to Hangman. In the original Hangman game, blank spaces or underscores are drawn for each letter of the word, and when a player guesses a letter, if the letter is present in the word, it is fil..
Variables and Constants Declaration In JavaScript, variables and constants are identifiers used to store values. Variables are used for data that can change, while constants are used for data that cannot be changed after assignment. Variable Declaration with let Variable declaration is done using the let keyword. When a variable is declared with let, it has block scope. Block scope means that th..