上次提到,在打磚塊上所使用的程式碼有哪些,後來本人的程式在運作時,因路徑上的關系有點BUG產生,此狀況有點不同,主要是出在以下程式碼上。
import pickle
with open("D:\\ML__\\MLGame-master\\games\\arkanoid\\log\\2019-09-25_13-55-23.pickle","rb") as f1:
data_list1 = pickle.load(f1)
with open("D:\\ML__\\MLGame-master\\games\\arkanoid\\log\\2019-09-25_14-11-39.pickle","rb") as f2:
data_list2 = pickle.load(f2)
with open("D:\\ML__\\MLGame-master\\games\\arkanoid\\log\\2019-09-25_16-27-51.pickle","rb") as f3:
data_list3 = pickle.load(f3)
Frame = []
Status = []
Ballposition = []
PlatformPosition = []
Bricks = []
for i in range(0,len(data_list1)):
Frame.append(data_list1[i].frame)
Status.append(data_list1[i].status)
Ballposition.append(data_list1[i].ball)
PlatformPosition.append(data_list1[i].platform)
Bricks.append(data_list1[i].bricks)
for i in range(0,len(data_list2)):
Frame.append(data_list2[i].frame)
Status.append(data_list2[i].status)
Ballposition.append(data_list2[i].ball)
PlatformPosition.append(data_list2[i].platform)
Bricks.append(data_list2[i].bricks)
for i in range(0,len(data_list3)):
Frame.append(data_list3[i].frame)
Status.append(data_list3[i].status)
Ballposition.append(data_list3[i].ball)
PlatformPosition.append(data_list3[i].platform)
Bricks.append(data_list3[i].bricks)
上方的下段 For 部分我們有介紹過了,但是現在的問題就是 with open 這個狀況,事實上路徑是正確的,但是程式卻有狀況打不開,懷疑是系統內部路徑出了狀況,因程式後面已經有在處理了所以希望可以呈現完美一點的程式給各位觀看,還請各位稍等時日。
也先謝謝支持的人的等待,本人(不專業的AI介紹)會繼續加油,趕緊生出最好的結果給各位看看。