Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. """Optymalizacja metodą brutal force"""
  2.  
  3.  
  4. 'zmienne'
  5. n = 3
  6. A = []
  7. for a in range (1,n+1):
  8.     for b in range (1,n+1):
  9.         for c in range (1,n+1):
  10.             for d in range (1,n+1):
  11.                 for e in range (1,n+1):
  12.                     for f in range (1,n+1):
  13.                         for g in range (1,n+1):
  14.                             for h in range (1,n+1):
  15.                                 pozycja=(h-1)+n*(g-1)+(n**2)*(f-1)+(n**3)*(e-1)+(n**4)*(d-1)+(n**5)*(c-1)+(n**6)*(b-1)+(n**7)*(a-1)
  16.                                 A.append(pozycja)
  17.  
  18.                                 'wynik = f(a,b,c,d,e,f,g,h)'
  19.                                 'tu coś liczysz'
  20.  
  21.  
  22.                                 '^^^ po matlabowemu: A[pozycja] = wynik'
  23.  
  24. print(A)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement