What's new
Roleplay UK

Join the UK's biggest roleplay community on FiveM and experience endless new roleplay opportunities!

Programmers Contest (Reward)

Ryuk

Well-known member
Heya, I'm having an exam in Informatics on Monday, we're c urrently working on the basic level Python programming.
I attached the code of a program that is supposed to make an image, takes the coordinates and the color and shows you a painted the image. The idea is to make the french flag.

There is something wrong with the code and I need your help so to make it more interesting the first person to propose me a working code will receive a reward (my total respect).

Here's what I came up with:

from PIL.Image import *
img = new("RGB", (1000,600))

def remplir(img, x1,x2,y1,y2,c):
for x in range(x1,x2):
for y in range(y1,y2):
Image.putpixel(img,x,y,c)

remplir(img,0,300,0,200,(100,200,0))
remplir(img,300,600,200,300,(200,100,0))


Happy resolving!

 
I do python at GCSE level and have never seen this kinda programming before

 
Hmmm, strange this is university level but it is still the basics, this whole chapter is about image manipulation, it does sound very specific that might be why...
Anyways thanks for playing!

 
ahha my friend at Uni has to make a house with Java I believe with something called blue something 

Good luck tho

 
Heya, I'm having an exam in Informatics on Monday, we're c urrently working on the basic level Python programming.
I attached the code of a program that is supposed to make an image, takes the coordinates and the color and shows you a painted the image. The idea is to make the french flag.

There is something wrong with the code and I need your help so to make it more interesting the first person to propose me a working code will receive a reward (my total respect).

Here's what I came up with:

from PIL.Image import *
img = new("RGB", (1000,600))

def remplir(img, x1,x2,y1,y2,c):
for x in range(x1,x2):
for y in range(y1,y2):
Image.putpixel(img,x,y,c)

remplir(img,0,300,0,200,(100,200,0))
remplir(img,300,600,200,300,(200,100,0))


Happy resolving!
Could've just asked for help instead of making it a competition to help you with your work

 
Back
Top