如何读取文本文件而不是使用情况?
load_cards 方法从磁盘读取文本文件,划分出每个卡片,并将结果赋给 @cards 实例变量。
The load_cards method handles reading in the text file from disk, splitting out each card, and assigning the results to the @cards instance variable.
请仔细观察parse方法。该类首先读取文本文件来获取初始值,然后读取数据库,进而将键更新为最新的值。
If you look carefully at the parse method, you see that the class first reads the text file for the initial values, then reads the database to update the keys to their latest values.
应用推荐