Last active
June 16, 2018 16:42
-
-
Save PixelyIon/e126dab31f07f81b2dd440f93469a9d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Made by ◱ PixelyIon (https://github.com/PixelyIon) | |
# Imports | |
import retro | |
import numpy as np | |
# Logic | |
file=open("ROMs.md","w") # Open up file to write to | |
cnsl=[] # Store the list of consoles | |
roms=[[],[]] # Store the list of games | |
for x in retro.list_games(): | |
consl=x[x.find("-")+1:] # Store the name of the console for the current game | |
try: # Catch the exception incase the console of the current game is not present in the cnsl array | |
ind=cnsl.index(consl) # Store the index of the first occurrence of a the console of the current game | |
except ValueError: # If the console of the current game is not in the cnsl array | |
cnsl.append(consl) # Append it to cnsl array | |
ind=cnsl.index(consl) # Store the index of the first occurrence of a the console of the current game | |
roms[ind].append(x) # Add the current game to the list | |
file.write("# Supported Consoles\n") | |
for x in cnsl: | |
file.write(f"* {x}\n") # Write stuff to the file | |
file.write("# Supported ROMs\n") | |
for x in cnsl: | |
file.write(f"## {x}\n") # Write stuff to the file | |
rms=roms[cnsl.index(x)] # Reference to the ROMs of the current console | |
for y in rms: | |
file.write(f"### **{y}**\n") # Write stuff to the file | |
for z in retro.list_states(y): | |
if(z[0]!="_"): | |
file.write(f"* {z}\n") # Write stuff to the file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment