فیلترشکن فعاله فیلترشکن فعاله

وقتی با دوستات میری بیرون

#‌include iostream
#‌include vector
#‌include cstdlib
#‌include ctime

using namespace std

const int width = 30 // بزرگتر کردن صفحه
const int height = 15
const int numObstacles = 20 // تعداد زیاد موانع

int carPos = width / 2
bool gameOver = false
int score = 0

struct Obstacle {
int x
int y
}

vectorObstacle obstacles

void initializeObstacles() {
obstacles.clear()
for (int i = 0 i numObstacles ++i) {
Obstacle obs
obs.x = rand() width
obs.y = rand() height
obstacles.push_back(obs)
}
}

void draw() {
system(clear) // اگر ویندوزی هستی: system(cls)

for (int y = 0 y height y++) {
for (int x = 0 x width x++) {
bool obstaclePrinted = false
for (auto &obs : obstacles) {
if (obs.x == x && obs.y == y) {
cout #
obstaclePrinted = true
break
}
}
if (!obstaclePrinted) {
if (y == height - 1 && x == carPos)
cout A // ماشین
else
cout
}
}
cout endl
}

cout امتیاز: score endl
cout حرکت: (a: چپ, d: راست, s: ثابت)
}

void update() {
for (auto &obs : obstacles) {
obs.y++
if (obs.y = height) {
obs.y = 0
obs.x = rand() width
score++
}

// بررسی برخورد
if (obs.y == height - 1 && obs.x == carPos) {
gameOver = true
}
}
}

int main() {
srand(time(0))

initializeObstacles()

while (!gameOver) {
draw()

char move
cin move

if (move == a && carPos 0)
carPos--
else if (move == d && carPos width - 1)
carPos++
// s = بدون حرکت

update()
}

cout بازی تمام شد! امتیاز نهایی: score endl

return 0
}#‌include iostream
#‌include vector
#‌include cstdlib
#‌include ctime

using namespace std

const int width = 30 // بزرگتر کردن صفحه
const int height = 15
const int numObstacles = 20 // تعداد زیاد موانع

int carPos = width / 2
bool gameOver = false
int score = 0

struct Obstacle {
int x
int y
}

vectorObstacle obstacles

void initializeObstacles() {
obstacles.clear()
for (int i = 0 i numObstacles ++i) {
Obstacle obs
obs.x = rand() width
obs.y = rand() height
obstacles.push_back(obs)
}
}

void draw() {
system(clear) // اگر ویندوزی هستی: system(cls)

for (int y = 0 y height y++) {
for (int x = 0 x width x++) {
bool obstaclePrinted = false
for (auto &obs : obstacles) {
if (obs.x == x && obs.y == y) {
cout #
obstaclePrinted = true
break
}
}
if (!obstaclePrinted) {
if (y == height - 1 && x == carPos)
cout A // ماشین
else
cout
}
}
cout endl
}

cout امتیاز: score endl
cout حرکت: (a: چپ, d: راست, s: ثابت)
}

void update() {
for (auto &obs : obstacles) {
obs.y++
if (obs.y = height) {
obs.y = 0
obs.x = rand() width
score++
}

// بررسی برخورد
if (obs.y == height - 1 && obs.x == carPos) {
gameOver = true
}
}
}

int main() {
srand(time(0))

initializeObstacles()

while (!gameOver) {
draw()

char move
cin move

if (move == a && carPos 0)
carPos--
else if (move == d && carPos width - 1)
carPos++
// s = بدون حرکت

update()
}

cout بازی تمام شد! امتیاز نهایی: score endl

return 0
}#‌include iostream
#‌include vector
#‌include cstdlib
#‌include ctime

using namespace std

const int width = 30 // بزرگتر کردن صفحه
const int height = 15
const int numObstacles = 20 // تعداد زیاد موانع

int carPos = width / 2
bool gameOver = false
int score = 0

struct Obstacle {
int x
int y
}

vectorObstacle obstacles

void initializeObstacles() {
obstacles.clear()
for (int i = 0 i numObstacles ++i) {
Obstacle obs
obs.x = rand() width
obs.y = rand() height
obstacles.push_back(obs)
}
}

void draw() {
system(clear) // اگر ویندوزی هستی: system(cls)

for (int y = 0 y height y++) {
for (int x = 0 x width x++) {
bool obstaclePrinted = false
for (auto &obs : obstacles) {
if (obs.x == x && obs.y == y) {
cout #
obstaclePrinted = true
break
}
}
if (!obstaclePrinted) {
if (y == height - 1 && x == carPos)
cout A // ماشین
else
cout
}
}
cout endl
}

cout امتیاز: score endl
cout حرکت: (a: چپ, d: راست, s: ثابت)
}

void update() {
for (auto &obs : obstacles) {
obs.y++
if (obs.y = height) {
obs.y = 0
obs.x = rand() width
score++
}

// بررسی برخورد
if (obs.y == height - 1 && obs.x == carPos) {
gameOver = true
}
}
}

int main() {
srand(time(0))

initializeObstacles()

while (!gameOver) {
draw()

char move
cin move

if (move == a && carPos 0)
carPos--
else if (move == d && carPos width - 1)
carPos++
// s = بدون حرکت

update()
}

cout بازی تمام شد! امتیاز نهایی: score endl

return 0
}
  • 🙈
  • 🙉
  • 🙊
  • 💛
  • 💔
  • 💯
  • 💢
  • 👍
  • 👎
  • 👏
  • 👈
  • 👉
  • 🙏
  • 💪
  • 🎬
  • 🐥
  • 🌹
  • 🍁
  • 🍉
  • 🍕
  • 🍳
  • 🎂
  • 🎈
  • 🌍
  • 💩
  • 🚗
  • 📙
  • 😀
  • 😂
  • 😉
  • 😊
  • 😍
  • 😘
  • 💋
  • 😋
  • 😜
  • 👀
  • 😐
  • 😕
  • 😎
  • 😌
  • 😒
  • 😬
  • 😔
  • 😢
  • 😭
  • 😷
  • 😎
  • 😨
  • 😱
  • 😡
  • 😠
😊

X
این ویدیو
×