pt순위
로그인 안될 시 카톡에서 강원/원주고/백승공에게 연락주세요.
<<<<<- 컴퓨터 프로그래밍 동아리 (2025)>>>>>
영원제 부스 아이디어
view : 119
1. 프로그래밍으로 보는 과학과 수학
실물 교구프로그래밍을 통한 시뮬레이션 비교 체험

실물 교수와
우리가 만든 시물레이션 프로그램을
비교체험해보는 코너.

만들어야 할 것
- 교구와 해당 교과 관련 설명 페이지
- 교구 관련 시뮬레이션 프로그램




2. 키보드 별 타자 속도 측정
키보드 종류별로 두고 키감 체험 및 타자 속도 측정

실행 예시
실행화면은 다른 스타일로 바꾸면 좋겠다.

예시 소스코드
import time

target_text = """북원뜰 울려오는 역사의 진군
설레는 가슴마다 이상을 품고
세계의 너른무대 나설 토대를
닦아서 쌓으려고 여기 배운다
끊임없이 쌓아서 그 이름 빛내리라
원고 원고 우리 모교 원고 원고 우리 모교"""

target_lines = target_text.split('\n')

print("=== 타자 연습 ===\n")
print("아래 문장을 그대로 입력하세요:\n")
print(target_text)
input("\n▶ 준비되면 Enter를 누르세요...\n")

print("=== 입력 시작 ===")
start = time.time()

user_lines = []

# ➤ 총 6줄이 입력될 때까지 반복
for i in range(len(target_lines)):
line = input()
user_lines.append(line)

end = time.time()

# 입력 합치기
typed_text = "\n".join(user_lines)

# 총 글자 수
total_chars = len(typed_text)

# 분당 타수
elapsed = end - start
wpm = total_chars / (elapsed / 60)

# 오타 계산
errors = 0
for a, b in zip(typed_text, target_text):
if a != b:
errors += 1
errors += abs(len(typed_text) - len(target_text))

accuracy = ((total_chars - errors) / total_chars) * 100 if total_chars > 0 else 0
error_rate = (errors / total_chars) * 100 if total_chars > 0 else 0

print("
=== 결과 ===")
print(f"총 입력 글자 수: {total_chars}타")
print(f"걸린 시간: {elapsed:.2f}초")
print(f"분당 타수: {wpm:.2f}타")
print(f"총 오타 수: {errors}개")
print(f"정확도: {accuracy:.2f}%")
print(f"오타율: {error_rate:.2f}%")

소스코드 v2
import time
from type_score import send_score

# ================= 기준 문장 =================
TARGET_LINES = [
"북원뜰 울려오는 역사의 진군",
"설레는 가슴마다 이상을 품고",
"세계의 너른 무대 나설 토대를",
"닦아서 쌓으려고 여기 배운다",
"끊임없이 쌓아서 그 이름 빛내리라",
"원고 원고 우리 모교 원고 원고 우리 모교"
]

PROBLEM_ID = 1 # 문제 번호 (필요 시 변경)

# ================= 한글 자모 상수 =================
CHOSUNG = "ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ"
JUNGSUNG = "ㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣ"
JONGSUNG = [""] + list("ㄱㄲㄳㄴㄵㄶㄷㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅄㅅㅆㅇㅈㅊㅋㅌㅍㅎ")

# ================= 한글 분해 =================
def decompose_hangul(text):
"""문자열을 자음·모음 단위 리스트로 변환 (공백 제외)"""
result = []
for ch in text:
if '가' <= ch <= '힣':
code = ord(ch) - 0xAC00
cho = code // 588
jung = (code % 588) // 28
jong = code % 28
result.append(CHOSUNG[cho])
result.append(JUNGSUNG[jung])
if JONGSUNG[jong]:
result.append(JONGSUNG[jong])
elif ch != " ":
result.append(ch)
return result

# ================= 자모 비교 =================
def compare_jamo(target, user):
t = decompose_hangul(target)
u = decompose_hangul(user)
correct = sum(1 for i in range(min(len(t), len(u))) if t[i] == u[i])
return correct, len(t)

# ================= 메인 =================
def main():
print("=== 타자 검정 프로그램 ===")

# -------- 학번 입력 --------
while True:
student_id = input("학번 5자리를 입력하세요: ").strip()
if student_id.isdigit() and len(student_id) == 5:
break
print("❌ 학번은 숫자 5자리여야 합니다.")

# -------- 엔터만 눌러서 시작 --------
print("\n타자검정을 시작하려면 엔터만 누르세요.")
while True:
key = input()
if key == "":
break
print("❌ 엔터만 눌러주세요. 다른 글자는 입력할 수 없습니다.")

# -------- 타자검정 시작 --------
total_correct = 0
total_target_jamo = 0
total_input_jamo = 0
start_time = time.time()

for idx, line in enumerate(TARGET_LINES, 1):
print(f"\n[{idx}번 문장]")
print("원문:",line)

# 문장 입력 시간 측정
line_start = time.time()
user_input = input("입력: ")
line_end = time.time()
elapsed_line = line_end - line_start

# 문장 단위 채점
correct, target_count = compare_jamo(line, user_input)
input_count = len(decompose_hangul(user_input))

total_correct += correct
total_target_jamo += target_count
total_input_jamo += input_count

# 문장 단위 정확도와 분당 타수
accuracy_line = (correct / target_count) * 100
typing_speed_line = (input_count / elapsed_line) * 60

print(f"문장 정확도: {accuracy_line:.5f}%")
print(f"문장 분당 타수: {typing_speed_line:.5f}")

# 전체 계산
elapsed = time.time() - start_time
accuracy_total = (total_correct / total_target_jamo) * 100
typing_speed_total = (total_input_jamo / elapsed) * 60
final_score = typing_speed_total * (accuracy_total / 100)

print("\n=== 최종 결과 ===")
print(f"학번: {student_id}")
print(f"총 분당 타수: {typing_speed_total:.5f}")
print(f"전체 정확도: {accuracy_total:.5f}%")
print(f"최종 점수: {final_score:.5f}")

# -------- 점수 서버 전송 --------
print("\n점수를 서버에 전송합니다...")
send_score(student_id, PROBLEM_ID, final_score)

def run():
while True:
main()

print("\n다시 하시겠습니까? (Y/N): ", end="")
answer = input().strip().lower()

if answer not in ("y", "yes", "ㅛ"):
print("프로그램을 종료합니다.")
break

if __name__ == "__main__":
run()

점수 저장 코드
import requests
import json

def send_score(student_id, problem_id, score):
# PHP 파일이 호스팅된 URL 주소
url = " https://wonjugo.dothome.co.kr/booth2025/save_score.php "

# 전송할 데이터
payload = {
"student_id": student_id,
"problem_id": problem_id,
"score": score
}

# 헤더 설정
headers = {'Content-Type': 'application/json'}

try:
response = requests.post(url, data=json.dumps(payload), headers=headers)

if response.status_code == 200:
print("성공:", response.json())
else:
print(f"오류 발생 (상태 코드: {response.status_code}):", response.text)

except Exception as e:
print("연결 실패:", e)

타자 검정 실행 batch file
@echo off

REM booth 폴더로 이동
cd /d C:\Users\user\Desktop\booth

REM 가상환경 활성화
call Scripts\activate

REM 파이썬 파일 실행
python typewrite.py

REM 창 유지 (필요 없으면 삭제)
pause

만들어야 할 것
- 각 키보드별 설명 페이지
- 타자 측정 프로그램 (위와 같은 스타일은 좀...)
- 타자 측정 기록 웹페이지 - 스코어보드




계속 하기
def run():
while True:
main()

print("\n다시 하시겠습니까? (Y/N): ", end="")
answer = input().strip().lower()

if answer not in ("y", "yes"):
print("프로그램을 종료합니다.")
break

3. 파이선 활용 교구 체험
교구 및 코딩 준비해야 함.

만들어야 할 것
- 드론 조종 프로그램
 이미 있지만 부스 운영에 편리한 형태로 수정
- 로봇팔 조종 프로그램
 이미 있지만 영상 인식의 형태로 수정

영원제 부스 아이디어
<<<<<- 컴퓨터 프로그래밍 동아리 (2025)>>>>>
99 (634) / 121 (1,546) / 93,327 (382,938)

since 2023.07.27
zackie class in korea = zclx.kr
since 2021.07.05 zackie school in korea = zskool.kr
since 2015.03.01 zackie school = zskool.com