♦️بازی مار با پایتون
🔹نکته: باید کتابخانه pygame رو نصب داشته باشید
import pygame
import random
pygame.init()
# تعریف متغیرها
SCREEN_WIDTH, SCREEN_HEIGHT = 640, 480
CELL_SIZE = 20
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption("بازی مار ساده")
clock = pygame.time.Clock()
snake_pos = [(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2)]
snake_direction = (CELL_SIZE, 0)
snake_length = 1
food_pos = (random.randrange(1, SCREEN_WIDTH // CELL_SIZE) * CELL_SIZE,
random.randrange(1, SCREEN_HEIGHT // CELL_SIZE) * CELL_SIZE)
# حلقه اصلی بازی
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP and snake_direction != (0, CELL_SIZE):
snake_direction = (0, -CELL_SIZE)
elif event.key == pygame.K_DOWN and snake_direction != (0, -CELL_SIZE):
snake_direction = (0, CELL_SIZE)
elif event.key == pygame.K_LEFT and snake_direction != (CELL_SIZE, 0):
snake_direction = (-CELL_SIZE, 0)
elif event.key == pygame.K_RIGHT and snake_direction != (-CELL_SIZE, 0):
snake_direction = (CELL_SIZE, 0)
# حرکت مار
snake_pos[0] = (snake_pos[0][0] + snake_direction[0], snake_pos[0][1] + snake_direction[1])
# بررسی برخورد با مرزها
if snake_pos[0][0] >= SCREEN_WIDTH or snake_pos[0][0] < 0 or snake_pos[0][1] >= SCREEN_HEIGHT or snake_pos[0][1] < 0:
pygame.quit()
quit()
# بررسی برخورد با خود
if snake_pos[0] in snake_pos[1:]:
pygame.quit()
quit()
# بررسی برخورد با غذا
if snake_pos[0] == food_pos:
snake_length += 1
food_pos = (random.randrange(1, SCREEN_WIDTH // CELL_SIZE) * CELL_SIZE,
random.randrange(1, SCREEN_HEIGHT // CELL_SIZE) * CELL_SIZE)
# رسم مار و غذا
screen.fill(WHITE)
for pos in snake_pos:
pygame.draw.rect(screen, GREEN, (pos[0], pos[1], CELL_SIZE, CELL_SIZE))
pygame.draw.rect(screen, RED, (food_pos[0], food_pos[1], CELL_SIZE, CELL_SIZE))
pygame.display.update()
clock.tick(10)
◦•◉✿ @python_rd ✿◉•◦
🔹نکته: باید کتابخانه pygame رو نصب داشته باشید
import pygame
import random
pygame.init()
# تعریف متغیرها
SCREEN_WIDTH, SCREEN_HEIGHT = 640, 480
CELL_SIZE = 20
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption("بازی مار ساده")
clock = pygame.time.Clock()
snake_pos = [(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2)]
snake_direction = (CELL_SIZE, 0)
snake_length = 1
food_pos = (random.randrange(1, SCREEN_WIDTH // CELL_SIZE) * CELL_SIZE,
random.randrange(1, SCREEN_HEIGHT // CELL_SIZE) * CELL_SIZE)
# حلقه اصلی بازی
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP and snake_direction != (0, CELL_SIZE):
snake_direction = (0, -CELL_SIZE)
elif event.key == pygame.K_DOWN and snake_direction != (0, -CELL_SIZE):
snake_direction = (0, CELL_SIZE)
elif event.key == pygame.K_LEFT and snake_direction != (CELL_SIZE, 0):
snake_direction = (-CELL_SIZE, 0)
elif event.key == pygame.K_RIGHT and snake_direction != (-CELL_SIZE, 0):
snake_direction = (CELL_SIZE, 0)
# حرکت مار
snake_pos[0] = (snake_pos[0][0] + snake_direction[0], snake_pos[0][1] + snake_direction[1])
# بررسی برخورد با مرزها
if snake_pos[0][0] >= SCREEN_WIDTH or snake_pos[0][0] < 0 or snake_pos[0][1] >= SCREEN_HEIGHT or snake_pos[0][1] < 0:
pygame.quit()
quit()
# بررسی برخورد با خود
if snake_pos[0] in snake_pos[1:]:
pygame.quit()
quit()
# بررسی برخورد با غذا
if snake_pos[0] == food_pos:
snake_length += 1
food_pos = (random.randrange(1, SCREEN_WIDTH // CELL_SIZE) * CELL_SIZE,
random.randrange(1, SCREEN_HEIGHT // CELL_SIZE) * CELL_SIZE)
# رسم مار و غذا
screen.fill(WHITE)
for pos in snake_pos:
pygame.draw.rect(screen, GREEN, (pos[0], pos[1], CELL_SIZE, CELL_SIZE))
pygame.draw.rect(screen, RED, (food_pos[0], food_pos[1], CELL_SIZE, CELL_SIZE))
pygame.display.update()
clock.tick(10)
◦•◉✿ @python_rd ✿◉•◦
بهترین سایت ها برای نوشتن رزومه انگلیسی:
https://resumegenius.com
ساخت رزومه در یک دقیقه
https://www.resume.com
ساخت رزومه ی حرفه ای
https://www.topresume.com
بررسی میکنه که آیا رزومه تون خوبه یا نه
https://www.visualcv.com
ساخت رزومه
⠀◦•◉✿ @python_rd ✿◉•◦
https://resumegenius.com
ساخت رزومه در یک دقیقه
https://www.resume.com
ساخت رزومه ی حرفه ای
https://www.topresume.com
بررسی میکنه که آیا رزومه تون خوبه یا نه
https://www.visualcv.com
ساخت رزومه
⠀◦•◉✿ @python_rd ✿◉•◦
Resume Genius
Free AI Resume Builder - Resume Genius
Applying for jobs is hard, but our resume builder makes it easy. Download free templates, read expert writing guides, and try our software today.
هوش مصنوعی های کاربردی:
Brandmark.io
برات لوگو میسازه
Despair.org
باهاش nft بساز
Keytex
کسب درآمد دلاری
D-id
گوینده رایگان
Tome.app
برات پاورپوینت درست میکنه
Soundraw
برات آهنگ میسازه
Vectorstock
برات سایت میسازه
⠀◦•◉✿ @python_rd ✿◉•◦
Brandmark.io
برات لوگو میسازه
Despair.org
باهاش nft بساز
Keytex
کسب درآمد دلاری
D-id
گوینده رایگان
Tome.app
برات پاورپوینت درست میکنه
Soundraw
برات آهنگ میسازه
Vectorstock
برات سایت میسازه
⠀◦•◉✿ @python_rd ✿◉•◦
یادگیری عمیق.pdf
6.7 MB
کتاب یادگیری عمیق: اصول، مفاهیم و رویکردها
کاملترین منبع فارسی یادگیری عمیق
#book
#کتاب
#یادگیری_عمیق
⠀◦•◉✿ @python_rd ✿◉•◦
کاملترین منبع فارسی یادگیری عمیق
#book
#کتاب
#یادگیری_عمیق
⠀◦•◉✿ @python_rd ✿◉•◦
نقشه راه یادگیری پایتون
instagram:
https://instagram.com/programming.inf?igshid=NzZlODBkYWE4Ng==
★彡 @rezadolati01 彡★
instagram:
https://instagram.com/programming.inf?igshid=NzZlODBkYWE4Ng==
★彡 @rezadolati01 彡★
PyCoders (پایتون)
Photo
NLP with python O'reilly.pdf
3.4 MB
معرفی کتاب:
📕Book: Natural Language Processing with Python
👨🏫 Author: Steven Bird, ...
✅ Pages: 504
💥 Publisher: O'reilly
📕Book: Natural Language Processing with Python
👨🏫 Author: Steven Bird, ...
✅ Pages: 504
💥 Publisher: O'reilly
سایت برای یادگیری پایتون و هوشمصنوعی با انجام پروژه های واقعی
data-flair.training
⠀◦•◉✿ @python_rd ✿◉•◦
data-flair.training
⠀◦•◉✿ @python_rd ✿◉•◦
Media is too big
VIEW IN TELEGRAM
تکنولوژی جدید هوش مصنوعی که میتونه تو آینده، جای خیلی از کارها رو بگیره مثل جلسه های حضوری و... توی ویدیو متوجه میشید👌
⠀◦•◉✿ @python_rd ✿◉•◦
⠀◦•◉✿ @python_rd ✿◉•◦