Python Forum
The problem of the cuts
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The problem of the cuts
#3
(Jan-19-2017, 08:21 PM)micseydel Wrote: What have you tried? Do you have a specific question?

I have tried to implement this, but it won't compile


### [1,3] :vx (holes)




def cuts(x,y,L,h):
    for i in range(nrg):
        if vx[i] > x and vx[i] < x+L and vy[i] > y and vy[i] <y+h:
            found = True
            break
    if found:
        1: couts(x,y,L-vx[i],h)
        2: cuts(vx[i],y,L-vx[i]+x,h)
        3: cuts(L-vx[i],y,L-vx[i],h)
        4: cuts(x,h-y,L,h-y)
    else:
        ar = L*h
        if ar > arMax:
            arMax = ar

nrg = 2
vx[1] = [1,3]
vx[2] = [2,3]
[x,y,L,h]
sol[0] = x
sol[1] = y
sol[2] = L
sol[3] = h
Reply


Messages In This Thread
The problem of the cuts - by ics - Jan-19-2017, 07:35 PM
RE: The problem of the cuts - by micseydel - Jan-19-2017, 08:21 PM
RE: The problem of the cuts - by ics - Jan-19-2017, 08:37 PM
RE: The problem of the cuts - by micseydel - Jan-19-2017, 08:39 PM
RE: The problem of the cuts - by wavic - Jan-19-2017, 08:48 PM
RE: The problem of the cuts - by ics - Jan-19-2017, 08:48 PM
RE: The problem of the cuts - by micseydel - Jan-19-2017, 08:53 PM
RE: The problem of the cuts - by ics - Jan-19-2017, 09:01 PM
RE: The problem of the cuts - by ichabod801 - Jan-19-2017, 10:39 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020