랜덤 워크(Random Walk)를 사용하여 **아트적인 노이즈 트레일(Artistic Noise Trail)**을 만드는 것은 제너레이티브 아트(Generative Art)에서 매우 흔하고 흥미로운 기법입니다. 이는 각 단계에서 **무작위성(Stochasticity)**을 이용해 경로를 결정함으로써 예측 불가능하면서도 유기적인 움직임을 만들어냅니다.
파이썬에서는 주로 turtle 또는 **matplotlib**을 사용하여 시각화할 수 있지만, 여기서는 제너레이티브 아트에 자주 사용되는 접근 방식인 랜덤 증분을 이용해 구현해 보겠습니다.
"""
랜덤 워크(Random Walk)를 사용하여 **아트적인 노이즈 트레일(Artistic Noise Trail)**을 만드는 것은 제너레이티브 아트(Generative Art)에서 매우 흔하고 흥미로운 기법입니다. 이는 각 단계에서 **무작위성(Stochasticity)**을 이용해 경로를 결정함으로써 예측 불가능하면서도 유기적인 움직임을 만들어냅니다.
파이썬에서는 주로 turtle 또는 **matplotlib**을 사용하여 시각화할 수 있지만, 여기서는 제너레이티브 아트에 자주 사용되는 접근 방식인 랜덤 증분을 이용해 구현해 보겠습니다.
"""
import numpy as np
import matplotlib.pyplot as plt
def generate_random_walk_trail(steps, noise_strength=1):
"""
주어진 단계 수만큼 랜덤 워크 트레일 데이터를 생성합니다.
:param steps: 랜덤 워크를 진행할 단계 수
:param noise_strength: 노이즈/이동 강도 (클수록 경로가 거칠어짐)
:return: x, y 좌표 배열
"""
# 각 단계에서의 x, y 변화량 (랜덤 증분)을 생성합니다.
# -noise_strength부터 +noise_strength 사이의 균일 분포 난수
dx = np.random.uniform(-noise_strength, noise_strength, steps)
dy = np.random.uniform(-noise_strength, noise_strength, steps)
# 누적합을 계산하여 경로(트레일)를 만듭니다.
# 각 지점은 이전 지점에서의 변화량을 누적한 결과입니다.
x_trail = np.cumsum(dx)
y_trail = np.cumsum(dy)
return x_trail, y_trail
# --- 시각화 설정 ---
STEPS = 5000 # 경로 길이
NOISE_LEVEL = 1.5 # 노이즈 강도 조절
x_coords, y_coords = generate_random_walk_trail(STEPS, NOISE_LEVEL)
# Matplotlib으로 트레일 시각화
fig, ax = plt.subplots(figsize=(10, 10))
ax.plot(x_coords, y_coords,
color='white', # 선 색상
linewidth=0.5, # 선 두께
alpha=0.8) # 투명도
# 배경 및 축 설정
ax.set_facecolor('black')
ax.set_xticks([])
ax.set_yticks([])
ax.set_title(f"Random Walk Artistic Noise Trail ({STEPS} steps)", color='white')
# 축 비율을 같게 설정하여 왜곡 방지
ax.set_aspect('equal', adjustable='box')
plt.show()
import numpy as np
import matplotlib.pyplot as plt
steps = np.random.choice([1, -1], size=(2,1000))
pos = np.cumsum(steps, axis=1)
plt.plot(pos[0], pos[1], color='lime')
plt.axis('off')
plt.title("Random walk path", color='green')
plt.show()
import turtle
import random
# 화면 설정
def setup_screen():
"""창을 설정하고 전체 화면과 유사하게 최대화합니다."""
screen = turtle.Screen()
screen.setup(width=1.0, height=1.0) # 화면 크기를 최대화합니다.
screen.title("무작위 선 그리기 (전체 화면)")
screen.colormode(255) # RGB 색상 모드를 0-255로 설정합니다.
screen.bgcolor("black") # 배경색을 검은색으로 설정합니다.
screen.tracer(0) # 그리기 속도를 높이기 위해 자동 화면 업데이트를 끕니다.
return screen
# 거북이 설정
def setup_turtle():
"""선을 그릴 거북이를 설정합니다."""
t = turtle.Turtle()
t.hideturtle() # 거북이 아이콘을 숨깁니다.
t.speed(0) # 최고 속도로 설정합니다.
t.pensize(2) # 펜 두께를 설정합니다.
return t
# 무작위 색상 생성
def get_random_color():
"""무작위 RGB 색상 튜플을 반환합니다."""
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
return (r, g, b)
# 메인 그리기 루프
def draw_random_lines(t, screen):
"""화면이 종료될 때까지 무작위 선을 계속 그립니다."""
while True:
# 무작위 색상 및 위치 설정
color = get_random_color()
t.pencolor(color)
# 펜을 든 상태로 무작위 위치로 이동 (현재 위치에서 그리기 시작)
t.left(random.randint(-180, 180)) # 무작위로 방향을 돌립니다.
# 무작위 길이만큼 앞으로 이동 (선을 그림)
distance = random.randint(50, 300)
t.forward(distance)
# 화면 가장자리를 벗어났는지 확인하고, 벗어났다면 펜을 들고 중앙 근처로 이동
# 이 과정이 없으면 거북이가 화면 밖으로 나가버려 그림이 멈춘 것처럼 보일 수 있습니다.
current_x, current_y = t.position()
screen_width = screen.window_width()
screen_height = screen.window_height()
if abs(current_x) > screen_width / 2 or abs(current_y) > screen_height / 2:
t.penup() # 펜 들기
t.goto(0, 0) # 중앙으로 이동
t.left(random.randint(-180, 180)) # 방향을 다시 무작위로 설정
t.pendown() # 펜 내리기
# 화면 업데이트 (tracer(0)를 사용했으므로 수동으로 업데이트)
screen.update()
# 프로그램 실행
if __name__ == "__main__":
screen = setup_screen()
t = setup_turtle()
try:
draw_random_lines(t, screen)
except turtle.Terminator:
# 창 닫기 버튼을 눌렀을 때 발생하는 예외 처리
print("프로그램이 종료되었습니다.")
except Exception as e:
print(f"예외 발생: {e}")
# 창을 닫을 때까지 프로그램이 대기하도록 함 (실제 draw_random_lines 루프에서는 필요 없음)
# turtle.done()
PHP 8.5 is out soon, and honestly, it’s one of those releases that makes me excited as a developer. Some of the features are small, but they justfeel so right, you know? I’m talking about stuff that just makes your life easier every single day. Let me take you through it.
Pipe Operator: No More Temporary Variables
The pipe operator, you’ve probably seen it floating around in tweets and RFCs. And yes, it’s actuallyuseful.
Imagine this: you have a function calledsendEmail. It takes an email address, but before you send it, you want to clean it up. Trim spaces, make it lowercase… usual stuff. Before PHP 8.5, you might do something like this:
No temporary variables, everything flows left to right. Makes your code so much cleaner.
No Discard Attribute: Stop Ignoring Return Values
Next up,#[NoDiscard]. This is actually amazing. Sometimes you call a function, and youmustuse the return value, but people (or even yourself) might forget. PHP 8.5 can now warn you if you ignore it.
#[NoDiscard]
function getName(): string {
return "Nuno";
}
If you do this:
getName(); // PHP will warn you: "Hey, you should use the return value!"
It forces you to handle the result or explicitly cast to void if you really mean to ignore it. Honestly, this one istop three features for me. You combine this with the pipe operator, and you can write clean, safe chains without warnings.
Closures in Constant Expressions
PHP 8.5 now lets you usestatic closures in places that only accept compile-time values. Class constants, default property values, attribute arguments… you can now use closures in all of them.
class Example {
public const VALIDATOR = static function($value) {
return !empty($value);
};
}
Before, this would fail, now it works. You can literally attach reusable logic directly to constants or attributes. This is huge for frameworks like Laravel that use a lot of validation or metadata.
Array Helpers:array_first()andarray_last()
You know how annoying it was to get the first or last element of an array? I mean, PHP hasreset()andend(), but they move the internal pointer. Now we have:
$users = ["Adrian", "Maria", "Pedro"];
$first = array_first($users); // Adrian
$last = array_last($users); // Pedro
It’s simple, intuitive, anddoesn’t mess with your array pointer. Little change, big difference.
Global Constants with Attributes
Another subtle one. PHP 8.5 now lets you addattributes to global constants. Before, this was impossible. Now, you can do something like:
It’s basically metadata for constants. If your framework or package uses constants for configuration, you can now attach extra info cleanly.
Get Exception Handler
For framework developers, this one is neat. PHP 8.5 introducesget_exception_handler(). If you’ve ever usedset_exception_handler(), you know it’s hard to inspect the existing closure. Now, you can actually grab it:
Perfect for logging, debugging, or even modifying exception handling at runtime. Frameworks like Laravel could makereal use of thisfor global error handling.
Intel List Formatter
And here’s a fun one:IntlListFormatter. Not something you’d use every day, but when you need it, it’s perfect. You can take a list and format it according to locale rules.
$formatter = new \Intl\IntlListFormatter('en', \Intl\IntlListFormatter::TYPE_AND);
echo $formatter->format(['Lisbon', 'Porto', 'Coimbra']); // "Lisbon, Porto, and Coimbra"
It handles “and”, “or”, and other localized ways of formatting lists automatically. Nice little quality-of-life improvement for internationalized apps.
Minor Internal and CLI-Only Improvements
Even the small improvements in PHP 8.5 make a difference, especially if you work with the CLI or care about internal debugging and configuration.
1.php.iniDiff (PHP-IN-DIFF)
Ever wish you could quickly see which settings you’ve changed from the default PHP configuration? PHP 8.5 makes thissuper easywith a new CLI command:
php -i --diff
This shows you exactly whichphp.inioptions differ from the defaults. For example, I always increase memory limits and disable timeouts for scripts while testing:
memory_limit = -1
max_execution_time = 0
Before, you had to manually compare or scroll throughphpinfo(). Now it’s literally built-in. Such asmall, but life-saving improvementfor anyone debugging PHP setups.
2. PHP Build Date Constant
PHP 8.5 introduces anew constantthat tells you exactly when the binary was built. Want to check?
echo PHP_BUILD_DATE;
Output:
2025-09-17 14:32:00
It’s perfect if you’re running multiple PHP binaries or want to verify the version/build you’re using. Nothing groundbreaking, but again, quality-of-life.
3. Final Property Promotion
PHP 8.5 improvesproperty promotionwith the ability to mark individual properties asfinal. You could already make an entire class final, but now you can targetspecific propertiesin your constructor:
class User {
public function __construct(
final public string $username,
public string $email
) {}
}
Now$usernamecannot be overridden in subclasses. It’s subtle, but for codebases where immutability matters, this is ahuge clarity win.
4. CLI and Debugging Tweaks
Other minor improvements include:
Better default error reporting when usingphp -doverrides.
Cleaner warnings for deprecated features in CLI mode.
Small optimizations under the hood that make scripts run slightly faster or consume less memory in edge cases.
None of these require code changes, but if you’re a framework developer or DevOps person, they makeday-to-day PHP usage smoother.
Why Even Minor Changes Matter
Here’s the thing: PHP 8.5 isn’t just about flashy features. Even small internal improvements and CLI tweaks reduce friction in your workflow. That’s the real magic here, less time fighting configuration, more time writing code that actually does something.
Final Thoughts
PHP 8.5 is packed withquality-of-life features. Not every one of them will change your world, but together they make the language smoother, safer, and more enjoyable.
Pipe operator: clean chains, no temp variables.
NoDiscard: never ignore important return values again.
Closures in constants: attach logic anywhere at compile time.
Array helpers: easy access to first and last elements.
Attributes on constants: add metadata cleanly.
Exception handler inspection: framework-friendly.
Intl list formatter: smart, localized lists.
PHP 8.5 feels likeone of those releases that makes you happy to write PHP again. It’s not flashy, but it’s clever, practical, and developer-first.
If you haven’t checked it out yet, start testing the beta. I guarantee some of these features will make their way straight into your daily coding habits.
게임형 인공지능(AI) 스타트업 알레프 랩(Aleph Lab)이 미국 실리콘밸리 대표 스타트업 액셀러레이터인 와이콤비네이터(YC)에 낙점됐다.
알레프랩은 올해 가을(F25) 와이콤비네이터 배치 프로그램에 선정돼 후속 투자를 유치했다고 16일 밝혔다. 지난 8월 설립 직후 크루캐피탈(Krew Capital)로부터 첫 투자를 받은 지 약 한 달 만이다.
알레프 랩은 아이들이 좋아하는 게임을 통해 자연스럽게 영어를 습득하는 경험을 목표로, AI 원어민 친구와 함께 게임 마인크래프트 안에서 실시간으로 대화하며 영어를 배우는 학습 서비스 ‘알레프 키즈(Aleph Kids)’를 개발하고 있다. 연내에 게임 플랫폼 ‘로블록스’에서도 서비스를 지원할 계획이다.
알레프 키즈의 첫 번째 AI 원어민 친구 ‘애니’(Annie)는 단순한 대화형 챗봇이 아닌 AI 에이전트로, 주변 환경을 인식해 아이의 답변을 유도하는 질문을 생성하며 자연스러운 언어 학습을 설계했다.
학습자의 흥미, 언어 수준, 게임 상황을 실시간으로 분석해 맞춤형 학습 커리큘럼을 생성하고, 놀면서 배우는 경험(learn through play)을 제공하는 것이 목표다.
투자금은 이후 로블록스 등 인기 게임 속 AI 친구 출시, 스페인어와 프랑스어 등 언어 확장, 수학·과학 등 과목 추가, 성인 대상 학습 서비스 출시 등 제품 확장에 활용될 예정이다.
장한님·한관엽 공동대표는 “아이들이 값비싼 해외 영어캠프나 유학을 가지 않더라도, 언제 어디서나 AI 원어민 친구와 함께 놀면서 자연스럽게 영어 실력을 키우고 유창해질 수 있도록 하겠다”며 “아이들이 해외에 나가서 자신감 있게 영어로 대화하고, 학업과 커리어에서 더 많은 선택지를 가질 수 있는 세상을 만들 것”이라고 밝혔다.