CreateDopLocationOutfit()
state = {1,2,3,4,5}
xs = {613,292,372,450,533}
xs1 = {620,299,380,456,539}

function update()
  local bool = true
--  --out("\tstate={")
  for i=1,5 do
    local x,y = GetObjectPosition(state[i])
    SetObjectPosition(state[i],xs[i],y)
    local x,y = GetObjectPosition(state[i]+10)
    SetObjectPosition(state[i]+10,xs1[i],y)
--    bool = bool and (state[i] == i)
--    out(tostring(state[i])..",")
  end
  --out("}\n")
  for i=1,5,1 do
    if state[i] ~= i then
    bool=false
    out(tostring("error"..state[i]).. "      i"..i.."\n")
    end;
   end;
  if bool then
    finish_mini_game(true)
  end
end


table_1 = {670,200,820,200,820,450,670,450}
CreatePolygon(23,4,"table_1")
--ShowPolygon(23,true)
setCursor(23,13)
addstaticobjecttogame(101,"bg2_18_10",180,46,"")--bg2_18_13
setcolor(101,1,1,1,0)
addstaticobjecttogame(21,"BigTexture1",738,241,"",0,0,158,176)--k1_18_13
setcolor(21,1,1,1,0)
addstaticobjecttogame(22,"BigTexture1",749,252,"",158,0,168,148)--k2_18_13
setcolor(22,1,1,1,0)
addstaticobjecttogame(102,"bg1_18_10",100,46,"")--bg1_18_13



-- addactivobjecttogame(11,"BigTexture90",777,71 ,"","",0,0,0,0,90,508)--bookTaken8_18_10
-- addactivobjecttogame(12,"BigTexture90",697,74 ,"","",0,0,184,0,88,502)--bookTaken7_18_10
addactivobjecttogame(12,"BigTexture90",620,167 ,"","",0,0,366,625,91,398)--bookTaken5_18_10
addactivobjecttogame(11,"BigTexture90",539,235,"","",0,0,743,0,88,334)--bookTaken6_18_10
addactivobjecttogame(15,"BigTexture90",456,73 ,"","",0,0,831,309,90,499)--bookTaken4_18_10
addactivobjecttogame(14,"BigTexture90",380,128,"","",0,0,609,323,87,436)--bookTaken3_18_10
addactivobjecttogame(13,"BigTexture90",299,100,"","",0,0,743,334,88,468)--bookTaken2_18_10
-- addactivobjecttogame(18,"BigTexture90",221,66,"","",0,0,922,0,85,519)--bookTaken1_18_10


addactivobjecttogame(2,"BigTexture90",613,194 ,"","",0,0,0,508,95,362)--book5_18_10
addactivobjecttogame(1,"BigTexture90",533,251,"","",0,0,831,0,91,309)--book6_18_10

addactivobjecttogame(5,"BigTexture90",450,91 ,"","",0,0,514,323,95,469)--book4_18_10

addactivobjecttogame(4,"BigTexture90",372,154,"","",0,0,366,218,94,407)--book3_18_10

addstaticobjecttogame(7,"BigTexture90",765,72 ,"",90,0,94,491)--book8_18_10
addstaticobjecttogame(6,"BigTexture90",689,72 ,"",272,0,94,491)--book7_18_10
addactivobjecttogame(3,"BigTexture90",292,123,"","",0,0,272,491,94,436)--book2_18_10
addstaticobjecttogame(8,"BigTexture90",215,68,"",922,519,91,495)--book1_18_10

NewObj("yabloko_18_10","BigTexture90",627,495,"222",0,0,651,0,92,55)--
-- setcolor(obj.yabloko_18_10.id,1,1,1,0)

addstaticobjecttogame(19,"BigTexture90",633,362,"",366,0,148,218)--kn_vypad3_18_10
addstaticobjecttogame(20,"BigTexture90",627,257,"",514,0,137,323)--knig_vypad2_18_10
setcolor(19,1,1,1,0)
setcolor(20,1,1,1,0)

for i=11,15 do
  set_visible_object(i,false)
  setCursor(i,4)
end

  if flags.otkrylDvercy and not flags.vstavilKnigu then
  for i=1,5 do

    setCursor(i,13)
  end  
  end;
  
  
  if flags.otkrylDvercy and flags.vstavilKnigu and not flags.proshelKnigi then
  for i=1,10 do
    local a = GetRandom(1,5)
    local b = GetRandom(1,5)
    state[a],state[b] = state[b],state[a]
  end
  update()
  for i=1,5 do
    setCursor(i,4)
  end
  end;

addstaticobjecttogame(100,"bg_18_10",101,44,"")--bg_18_10

helpID = "655"