Last active
August 29, 2015 14:09
-
-
Save parastuffs/b987251f305bcc13d993 to your computer and use it in GitHub Desktop.
Car playlist for morons
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
CD_SIZE_MAX = 700 Mo; | |
cd_size = 0; | |
track_index = 0; | |
passengers.add(Quentin, Anthony, Aurélien, Florian); | |
car_playlist = empty(); | |
while(cd_size < CD_SIZE_MAX) { | |
for(moron in passengers) { | |
if(track_index < moron.total_track) { | |
track = moron.tracklist[track_index]; | |
if(!(car_playlist.constains(track))) { | |
car_playlist.append(track); | |
cd_size += sizeof(track); | |
if(cd_size > CD_SIZE_MAX) { | |
goto: burn_cd(); | |
} | |
} | |
} | |
track_index++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment