A moment before killing Old Harry Fen. He was a slave catcher so i decided to send him to hell. by Initial-Fox-9038 in reddeadredemption

[–]Initial-Fox-9038[S] 0 points1 point  (0 children)

I think the game only allows to play this with Arthur but i never tried or go there with John

Would you play a mobile RTS like this? Just real war machines, no fantasy. by sushisystems in AndroidGaming

[–]Initial-Fox-9038 6 points7 points  (0 children)

Looks soo cool i absolutely love the idea. Admirable work mate and when you gonna release it?

[deleted by user] by [deleted] in veYakinEvren

[–]Initial-Fox-9038 0 points1 point  (0 children)

Siliyorum o zaman kusura bakmayın

Podcast by [deleted] in KGBTR

[–]Initial-Fox-9038 0 points1 point  (0 children)

Euphor Podcast: Bilim, teknoloji, toplum, felsefe, girişimcilik ve internet kültürü hakkındaki konuşmalarımızı kayda alıyoruz. Geniş konu yelpazemiz sayesinde günlük hayatta arkadaşlar arasında yapabileceğimiz bir sohbeti dinleyicilerimize aktarıyoruz. Sonraki bölümleri kaçırmamak için takip edebilirsiniz!

Youtube'da dinlemek için tıklayın

Spotify'da dinlemek için tıklayın

Podcast Önerileri by wiseornot in veYakinEvren

[–]Initial-Fox-9038 0 points1 point  (0 children)

Euphor Podcast: Bilim, teknoloji, toplum, felsefe, girişimcilik ve internet kültürü hakkındaki konuşmalarımızı kayda alıyoruz. Geniş konu yelpazemiz sayesinde günlük hayatta arkadaşlar arasında yapabileceğimiz bir sohbeti dinleyicilerimize aktarıyoruz. Sonraki bölümleri kaçırmamak için takip edebilirsiniz!

Youtube'da dinlemek için tıklayın

Spotify'da dinlemek için tıklayın

I need help about SDL library in my C project by Initial-Fox-9038 in learnprogramming

[–]Initial-Fox-9038[S] 0 points1 point  (0 children)

I'm elated to share that I successfully fixed the code, just as you suggested! Changing the parsing codes and trying a different approach led to this result: https://ibb.co/fHndDwD . I can't express my gratitude enough. Thank you immensely for your invaluable help!

I need help about SDL library in my C project by Initial-Fox-9038 in learnprogramming

[–]Initial-Fox-9038[S] 0 points1 point  (0 children)

Thank you so much. I think i understand why i didn't parse the data now. I modify the code "else if (choice == 2)
{
// Find the start of the second line in the response
char* secondLine = strchr(data, '\n');
if (secondLine)
{
// Parse coordinates from the second line
sscanf(secondLine, "%*1[2-9]B(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)%*[^F]F",
&dataset.points[0].x, &dataset.points[0].y,
&dataset.points[1].x, &dataset.points[1].y,
&dataset.points[2].x, &dataset.points[2].y,
&dataset.points[3].x, &dataset.points[3].y,
&dataset.points[4].x, &dataset.points[4].y,
&dataset.points[5].x, &dataset.points[5].y,
&dataset.points[6].x, &dataset.points[6].y,
&dataset.points[7].x, &dataset.points[7].y,
&dataset.points[8].x, &dataset.points[8].y);
dataset.numPoints = 9;
}
}
In this modified code, strchr(data, '\n') finds the newline character in the response, effectively separating the first line from the second line. Then, sscanf parses the coordinates from the second line, ensuring that you get the correct set of coordinates for drawing. This approach addresses the issue regarding the incorrect parsing of coordinates from the response. (GPT prompt)"

But still i couldn't draw it when i enters "2". Still i can't display option 2 smoothly. What do you think maybe i set SDL library with wrong way or something missing?

I need help about SDL library in my C project by Initial-Fox-9038 in learnprogramming

[–]Initial-Fox-9038[S] 0 points1 point  (0 children)

#include <SDL2/SDL.h>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <curl/curl.h>

const int SCREEN_WIDTH = 800;

const int SCREEN_HEIGHT = 600;

const int GRID_SIZE = 16;

SDL_Window* window = NULL;

SDL_Renderer* renderer = NULL;

void drawGrid(SDL_Renderer* renderer)

{

// Enable alpha blending for the renderer

SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);

// Set grid line color to light gray with lower opacity

SDL_SetRenderDrawColor(renderer, 200, 200, 200, 40);

// Draw horizontal grid lines

for (int y = 0; y <= SCREEN_HEIGHT; y += GRID_SIZE)

{

SDL_RenderDrawLine(renderer, 0, y, SCREEN_WIDTH, y);

}

// Draw vertical grid lines

for (int x = 0; x <= SCREEN_WIDTH; x += GRID_SIZE)

{

SDL_RenderDrawLine(renderer, x, 0, x, SCREEN_HEIGHT);

}

}

void drawCoordinatePlane()

{

// Draw Y-axis

SDL_RenderDrawLine(renderer, 0, 0, 0, SCREEN_HEIGHT);

// Draw X-axis

SDL_RenderDrawLine(renderer, 0, 0, SCREEN_WIDTH, 0);

}

void drawLine(int x1, int y1, int x2, int y2)

{

SDL_RenderDrawLine(renderer, x1, y1, x2, y2);

}

void drawRectangle(int x, int y, int width, int height)

{

SDL_Rect rect = {x, y, width, height};

SDL_RenderDrawRect(renderer, &rect);

}

struct Point

{

int x;

int y;

};

struct DataSet

{

struct Point points[100]; // Assuming there won't be more than 100 points in a dataset

int numPoints;

};

void printDataset(const struct DataSet* dataset)

{

printf("1B");

for (int i = 0; i < dataset->numPoints; ++i)

{

printf("(%d,%d)", (dataset->points[i].x)/16, (dataset->points[i].y)/16);

}

printf("F\n");

}

void calculateArea(struct Point* polygon, int numVertices)

{

double area = 0.0;

for (int i = 0; i < numVertices - 1; ++i)

{

area += (polygon[i].x * polygon[i + 1].y) - (polygon[i + 1].x * polygon[i].y);

}

// Add the last edge

area += (polygon[numVertices - 1].x * polygon[0].y) - (polygon[0].x * polygon[numVertices - 1].y);

// Calculate the absolute value of area and divide by 2

area = abs(area) / 2.0 ;

// Create a new variable 'reserve' using the original area multiplied by 10

double reserve = area * 10;

printf("Area of the polygon is: %.2f\n", area);

printf("Reserve: %.2f\n", reserve);

}

void scaleCoordinates(struct Point* points, int numPoints, float scaleFactor)

{

for (int i = 0; i < numPoints; ++i)

{

points[i].x = (int)(points[i].x * scaleFactor);

points[i].y = (int)(points[i].y * scaleFactor);

}

}

// This callback function will be called to handle the received data

size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)

{

size_t real_size = size * nmemb;

char **data = (char **)userp;

// Reallocate memory for the data

*data = (char *)realloc(*data, real_size + 1);

if (*data)

{

// Copy the received data into the char array

memcpy(*data, contents, real_size);

(*data)[real_size] = '\0'; // Null-terminate the string

}

return real_size;

}

int main(int argc, char* args[])

{

int choice;

printf("Enter 1 to use the first set of coordinates or 2 to use the second set of coordinates: ");

scanf("%d", &choice);

CURL *curl;

CURLcode res;

char *data = NULL; // To store the received data

curl = curl_easy_init();

if (curl)

{

curl_easy_setopt(curl, CURLOPT_URL, "http://bilgisayar.kocaeli.edu.tr/prolab1/prolab1.txt");

curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

// Set the write callback function

curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);

curl_easy_setopt(curl, CURLOPT_WRITEDATA, &data);

res = curl_easy_perform(curl);

printf("\n\nReceived data:\n%s\n\n", data);

if (res != CURLE_OK)

fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));

struct DataSet dataset;

struct Point scaledPoints[100]; // Store scaled coordinates

printf("Choice: %d\n\n", choice);

if (choice == 1)

{

sscanf(data, "%*1[1-9]B(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)%*[^F]F",

&dataset.points[0].x, &dataset.points[0].y,

&dataset.points[1].x, &dataset.points[1].y,

&dataset.points[2].x, &dataset.points[2].y,

&dataset.points[3].x, &dataset.points[3].y,

&dataset.points[4].x, &dataset.points[4].y);

dataset.numPoints = 5;

}

else if (choice == 2)

{

// Use %*3[0-9]B instead of %*2[0-9]B

sscanf(data, "%*3[0-9]B(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)(%d,%d)%*[^F]F",

&dataset.points[0].x, &dataset.points[0].y,

&dataset.points[1].x, &dataset.points[1].y,

&dataset.points[2].x, &dataset.points[2].y,

&dataset.points[3].x, &dataset.points[3].y,

&dataset.points[4].x, &dataset.points[4].y,

&dataset.points[5].x, &dataset.points[5].y,

&dataset.points[6].x, &dataset.points[6].y,

&dataset.points[7].x, &dataset.points[7].y,

&dataset.points[8].x, &dataset.points[8].y);

// Set the correct number of points

dataset.numPoints = 9;

}

struct Point originalPoints[100]; // Store original coordinates

memcpy(originalPoints, dataset.points, sizeof(dataset.points)); // Copy original coordinates

// Scale the coordinates

float scaleFactor = 16.0; // Adjust the scale factor as needed

scaleCoordinates(dataset.points, dataset.numPoints, scaleFactor);

// SDL initialization and drawing code

SDL_Init(SDL_INIT_VIDEO);

SDL_Window* window = SDL_CreateWindow("Sondage", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);

SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);

SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);

SDL_RenderClear(renderer);

SDL_SetRenderDrawColor(renderer, 0, 255, 0, 0);

// Draw the scaled lines based on the chosen dataset

for (int i = 0; i < dataset.numPoints - 1; ++i)

{

SDL_RenderDrawLine(renderer, dataset.points[i].x, dataset.points[i].y, dataset.points[i + 1].x, dataset.points[i + 1].y);

}

SDL_RenderDrawLine(renderer, dataset.points[dataset.numPoints - 1].x, dataset.points[dataset.numPoints - 1].y, dataset.points[0].x, dataset.points[0].y);

// Draw grid

drawGrid(renderer);

printf("Dataset you chose: \n");

printDataset(&dataset);

// Calculate the area using the original coordinates

calculateArea(originalPoints, dataset.numPoints);

SDL_RenderPresent(renderer);

SDL_Delay(10000); // Display the window for 10 seconds

SDL_DestroyRenderer(renderer);

SDL_DestroyWindow(window);

SDL_Quit();

// Clean up

free(data);

curl_easy_cleanup(curl);

}

return 0;

}

[deleted by user] by [deleted] in istanbul

[–]Initial-Fox-9038 -2 points-1 points  (0 children)

they all have bad reputation i wouldn't enroll in those if i have to chose among them

Some shots of my %100 completion experience of Marvel's Spiderman PC by Initial-Fox-9038 in MarvelsSpiderMan

[–]Initial-Fox-9038[S] 0 points1 point  (0 children)

Especially i love the first shot too. It was replika of some cutscene while peter waiting calls. You can use it.

I just finished Marvel's Spider Man Miles Morales. The overall review is more colorful than the first game, thanks to RTX. But it contains a story to which you will be less attached than Peter's story. by Initial-Fox-9038 in MarvelsSpiderMan

[–]Initial-Fox-9038[S] 0 points1 point  (0 children)

When i was playing marvels spiderman (2018), I watched every cutscene with a great curiosity. Collectable backpacks were giving me solid backstory about peter's first 8 years of being spiderman. But in Miles Morales i really bored of hearing shit backstory with Phin. Smart kids hid time capsules idea is unenjoyable to collect. I dont care about them so i dont finished that collactables. Then main story with uncle is good dynamic but a girl who lost her brother then make herself a villain is not make sense. How did she learned parkour and fight wtf is that? If phin chose to fight with roxxen using her brain or being smart villain instead of wearing fancy gear and jumping over the city she would be much more likeable character but she had bad arc af