자유게시판
14,392 개

소소하게 수다나 떨자는 곳입니다. 무슨 얘기든지 좋습니다.
아무거나 한마디씩 남겨주세요.(광고만 아니라면).

결국 AI 가 세상의 종말을 앞당길 것

세상에둘도없는
2025년 02월 03일 22시 33분 33초 27

 

요즘 내가 무슨 바람이 불었는지 시나리오는

팽개치고 프로그램 언어 공부를 한답시고

유튜브 강의를 하루 5시간씩 보고 있다.

 

엑셀 VBA는 예전에 터득해서 이미 작품도?

하나 만들었지만 파이썬이나 인공지능이 궁금해

꾸역꾸역 듣고 있는데

 

뜬금없이 유튜브 쑈츠에 말로만 코딩이 가능

하다는 내용이 있길레... 나도 도전! ㅎ

 

그리고 AI 와 대화하며 두시간만에 앱을 하나

뚝딱 만들었다. 

 

아~ 물론 앱은 AI가 만들었고 나는 방향만 지정

하는 방식이다 , 예를 들자면 이렇게 명령....

 

1. 구슬 12개가 경주하는 앱을 만들어

 

2. 출발은 왼쪽에서 시작, 오른쪽에 결승점

 

3. 구슬 색은 빨강, 노랑, 파랑....

 

4. 거리는 팝업창으로 내가 입력할게

 

 

이정도 하면 신기하게 구슬이 움직이는 앱이

나오는데 여기에 약간의 양념을 친다, 물론 말로

 

5. 각각의 구슬 속도는 다르게 해

 

6. 트렉을 욕상 경기장처럼 타원으로 해

 

7. 11, 12번 구슬은 모양이 다르게 해

 

8. 타원을 돌때 외곽 구슬 속도 보정해

 

 

이렇게 명령 한번 할 때마다 군말없이 

에러 메세지 없는 코딩이 착착된다.

 

햐~ 이걸로 두시간 노니 내가 지금까지 왜 코딩을

공부하고 있나 회의감이 들고..

조만간 '프로그래머, 개발자'라는 직업도 사라질듯한

예감이 든다..  


물론 영화계도 그 여파를 벗어나지 못해

스턴트,, 엑스트라, 미술 모두 AI가 담당할 것이고

 

AI가 점령하는 그 자리에 있던 사람들은....

앞으로 다들 뭐해 먹고 살까?

 

총만 안들었을뿐 더 잔인하게 인간의 생활을

말살하니 터미네이터의 스카이넷이 실화가 된 느낌... 

 

 

제목 없음.jpg

 

 

참고로 내가 한 명령을 AI가 작성한 코드

 

import pygame
import sys
import random
import tkinter as tk
from tkinter import simpledialog
import math

# Pygame 초기화
pygame.init()

# 팝업창으로 거리 입력 받기
root = tk.Tk()
root.withdraw()
distance = simpledialog.askinteger("거리 입력", "경주 거리를 입력하세요 (미터):", 
                                 minvalue=900, maxvalue=2000)
if distance is None:
    sys.exit()

# 화면 설정
screen_info = pygame.display.Info()
SCREEN_WIDTH = screen_info.current_w
SCREEN_HEIGHT = 800
TRACK_START_Y = 50
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption(f"{distance}m 구슬 경주")

# 색상 정의
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
GREEN = (0, 255, 0)
BROWN = (139, 69, 19)
PINK = (255, 192, 203)
PURPLE = (128, 0, 128)
SKY_BLUE = (135, 206, 235)
GRAY = (200, 200, 200)

# 구슬 색상 리스트
BALL_COLORS = [
    WHITE,          # 1번 흰색
    YELLOW,         # 2번 노랑
    RED,            # 3번 빨강
    BLACK,          # 4번 검정
    BLUE,           # 5번 파랑
    GREEN,          # 6번 초록
    BROWN,          # 7번 브라운
    PINK,           # 8번 분홍
    PURPLE,         # 9번 보라
    SKY_BLUE,       # 10번 하늘색
    'SQUARE_WHITE', # 11번 흰색 사각형
    'SQUARE_YELLOW' # 12번 노랑 사각형
]

# 트랙 설정
TRACK_WIDTH = SCREEN_WIDTH - 100
TRACK_HEIGHT = SCREEN_HEIGHT - TRACK_START_Y - 50
BASE_CURVE_RADIUS = 150  # U자 모양을 위한 반지름
TRACK_LANE_WIDTH = 2  # 구슬 간격 줄임

# 시간과 속도 계산
SIMULATION_TIME = 35
total_track_length = distance
pixels_per_meter = (TRACK_WIDTH - 100) / distance

# 선 설정 (결승점 기준으로 역순 계산)
finish_line_x = SCREEN_WIDTH // 2
curve_end_x = finish_line_x - 400
curve_start_x = curve_end_x
start_line_x = curve_start_x + (distance - 850)

def calculate_track_position(distance_covered, lane):
    """트랙 위의 위치 계산"""
    straight1_length = distance - 850
    curve_length = BASE_CURVE_RADIUS * math.pi
    straight2_length = 400
    
    if distance_covered < straight1_length:  # 첫 직선 구간
        x = start_line_x - distance_covered
        y = TRACK_START_Y + (lane * TRACK_LANE_WIDTH)
        
    elif distance_covered < straight1_length + curve_length:  # U자 반원 구간
        curve_distance = distance_covered - straight1_length
        angle = (curve_distance / curve_length) * math.pi
        center_x = curve_start_x
        center_y = TRACK_START_Y + BASE_CURVE_RADIUS
        
        # 반원 시작점을 90도 앞에서 시작하고 시계 방향으로 회전
        x = center_x + BASE_CURVE_RADIUS * math.cos(-angle - math.pi/2)
        y = center_y + BASE_CURVE_RADIUS * math.sin(-angle - math.pi/2) + (lane * TRACK_LANE_WIDTH)
        
    else:  # 마지막 직선 구간
        remaining = distance_covered - (straight1_length + curve_length)
        x = curve_end_x + remaining
        y = TRACK_START_Y + 2 * BASE_CURVE_RADIUS + (lane * TRACK_LANE_WIDTH)
    
    return x, y

def draw_tracks():
    # 상단 정보 영역 구분선
    pygame.draw.line(screen, BLACK, (0, TRACK_START_Y - 10), (SCREEN_WIDTH, TRACK_START_Y - 10), 2)
    
    # U자 모양 트랙 그리기
    # 첫 직선 구간
    pygame.draw.line(screen, BLACK, 
                    (curve_start_x, TRACK_START_Y),
                    (start_line_x, TRACK_START_Y), 1)
    
    # U자 반원 구간 (시계 방향)
    rect = pygame.Rect(curve_start_x - BASE_CURVE_RADIUS, 
                      TRACK_START_Y, 
                      2 * BASE_CURVE_RADIUS, 
                      2 * BASE_CURVE_RADIUS)
    pygame.draw.arc(screen, BLACK, rect, math.pi/2, 3*math.pi/2, 1)
    
    # 마지막 직선 구간
    pygame.draw.line(screen, BLACK,
                    (curve_end_x, TRACK_START_Y + 2 * BASE_CURVE_RADIUS),
                    (finish_line_x, TRACK_START_Y + 2 * BASE_CURVE_RADIUS), 1)

    # 출발선과 결승선
    pygame.draw.line(screen, BLUE, (start_line_x, TRACK_START_Y - 5), 
                    (start_line_x, TRACK_START_Y + 5), 2)
    pygame.draw.line(screen, RED, (finish_line_x, TRACK_START_Y + 2 * BASE_CURVE_RADIUS - 5), 
                    (finish_line_x, TRACK_START_Y + 2 * BASE_CURVE_RADIUS + 5), 2)

    # 거리 표시
    section_distance = 200
    total_sections = distance // section_distance
    
    for i in range(1, total_sections):
        current_distance = i * section_distance
        if current_distance < distance - 850:
            x = start_line_x - (current_distance * pixels_per_meter)
            y = TRACK_START_Y
            pygame.draw.line(screen, GRAY, (x, y - 5), (x, y + 5), 1)
            distance_text = f"{current_distance}m"
            font = pygame.font.Font(None, 20)
            text = font.render(distance_text, True, BLACK)
            screen.blit(text, (x - 15, y - 20))

    # 시간 및 거리 정보 표시
    elapsed_time = (pygame.time.get_ticks() - start_time) / 1000
    time_text = f"Time: {elapsed_time:.1f}s"
    distance_info = f"Distance: {distance}m"
    font = pygame.font.Font(None, 30)
    screen.blit(font.render(time_text, True, BLACK), (10, 10))
    screen.blit(font.render(distance_info, True, BLACK), (200, 10))

# 구슬 초기화
ball_radius = 4
balls = []
for i in range(12):
    base_speed = total_track_length / (SIMULATION_TIME * 60)
    random_factor = random.uniform(0.95, 1.05)
    balls.append({
        'x': start_line_x,
        'y': TRACK_START_Y + (i * TRACK_LANE_WIDTH),
        'speed': base_speed * random_factor,
        'distance': 0,
        'finished': False,
        'finish_time': 0
    })

# 게임 상태
game_finished = False
start_time = pygame.time.get_ticks()

# 게임 루프
clock = pygame.time.Clock()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
        elif event.type == pygame.KEYDOWN:
            if event.key == pygame.K_ESCAPE:
                pygame.quit()
                sys.exit()

    screen.fill(WHITE)
    draw_tracks()

    # 구슬 이동 및 그리기
    all_finished = True
    for i, ball in enumerate(balls):
        if not ball['finished']:
            ball['distance'] += ball['speed']
            ball['x'], ball['y'] = calculate_track_position(ball['distance'], i)
            
            if ball['distance'] >= total_track_length:
                ball['finished'] = True
                ball['finish_time'] = (pygame.time.get_ticks() - start_time) / 1000
            all_finished = False

        # 구슬 그리기
        if BALL_COLORS[i] == 'SQUARE_WHITE':
            pygame.draw.rect(screen, BLACK, (int(ball['x'])-ball_radius-1, int(ball['y'])-ball_radius-1, 
                           (ball_radius+1)*2, (ball_radius+1)*2))
            pygame.draw.rect(screen, WHITE, (int(ball['x'])-ball_radius, int(ball['y'])-ball_radius, 
                           ball_radius*2, ball_radius*2))
        elif BALL_COLORS[i] == 'SQUARE_YELLOW':
            pygame.draw.rect(screen, BLACK, (int(ball['x'])-ball_radius-1, int(ball['y'])-ball_radius-1, 
                           (ball_radius+1)*2, (ball_radius+1)*2))
            pygame.draw.rect(screen, YELLOW, (int(ball['x'])-ball_radius, int(ball['y'])-ball_radius, 
                           ball_radius*2, ball_radius*2))
        else:
            pygame.draw.circle(screen, BLACK, (int(ball['x']), int(ball['y'])), ball_radius + 1)
            pygame.draw.circle(screen, BALL_COLORS[i], (int(ball['x']), int(ball['y'])), ball_radius)

    if all_finished and not game_finished:
        game_finished = True
        print("\n경주 결과:")
        sorted_balls = sorted(balls, key=lambda x: x['finish_time'])
        for i, ball in enumerate(sorted_balls):
            print(f"{i+1}등: {ball['finish_time']:.2f}초")

    pygame.display.flip()
    clock.tick(60)

 

 

 

* AI 없었으면 한달간은 고생하며 짰어야.... 

 

 

근데 프로그래밍이 말로만 한다고

결코 쉬운게 아니다. ㅎ

 

 

 

 

 

 

글 등록 순으로 정렬되었습니다 글쓴이 날짜 조회
공지
대상이 특정되는 비방,폭로 등의 글은 삭제합니다 13
새글 3번째 29초 영화제 출품! 록기 2025.02.03 26
새글 결국 AI 가 세상의 종말을 앞당길 것 세상에둘도없는 2025.02.03 27
새글 (독립영화 제작을 꿈꾸는 모든 분들께!) 열정과 사랑으로 만들어진 음악영화 <하와이 cinecine 2025.02.03 62
새글 요즘 드라마, 영화 일이 많이 없어서 고민이신 분들! 일이 힘들어, 잠시 쉬고 싶으신 분들 sjk3903 2025.02.03 105
무료로 뮤직비디오 찍어드립니다. 감성발라드 (ex 카더가든 나무) 문P디 2025.02.03 174
국민의힘이 여론을 조성하면,변호인단이 다음날 헌법재판관 회피 촉구 의견서를 내는 식이다 pcps78 2025.02.02 46
전한길 -계몽령 ? 웃기는 놈일세 -부산--1-전한길2-백남준의발자취3-책소개 삶은공학 pcps78 2025.02.02 89
추울 때 보면 더 추워지는 영화 달과바람 2025.02.02 37
봄비 창원통기타 2025.02.01 23
최근 감명깊게 본 영화 소감 김민철님 2025.02.01 58
DI 다음 작품을 찾습니다 :) gwanjae 2025.02.01 96
엉거주춤 최상목 대행 2025 01 18-6000 pcps78 2025.01.31 34
최선의회복 -전체의조화 -2025 0131 pcps78 2025.01.31 32
빨갱이 나라 관광 세상에둘도없는 2025.01.30 139
한때 김어준도 부정선거를 주장했었다. The Plan (2017, 다큐) 2 세상에둘도없는 2025.01.30 114
내란수괴와 동조 또는 협력자들 pcps78 2025.01.30 88
1-내란옹호자 식별 어려움 2-2025 01 시총순위와 금액 pcps78 2025.01.29 38
계엄촉발일지(신빙성 있는 추론)-그리고 평화에대해 pcps78 2025.01.29 36
존경하는 한산이가 작가님이자 이낙준 의사 선생님에게 연극배우 서형윤 올림 형윤 2025.01.29 184
계엄촉발일지(신빙성 있는 추론) pcps78 2025.01.29 71
1 / 720
다음
게시판 설정 정보