Duckapple / Kat

Kattis shell for getting examples, testing and submitting.
18 stars 6 forks source link

add --randomsound command #35

Closed koshaan closed 3 years ago

koshaan commented 4 years ago

Add a --randomsound command that picks a random sound from a library of x sounds, when you successfully submit a problem.

jlndk commented 4 years ago

would maybe either be best to replace or compliment with a way to define this in the upcoming config file. This should perhaps be merged with or succeed issue #34.

koshaan commented 4 years ago

I would suggest 3 modes. No sound, specific sound (with a default sound being the current one) and a random that would be a random from a library of sounds. Maybe even allow custom ones.

jlndk commented 4 years ago

Sounds like a good idea :D (assuming we distribute multiple sound files).

My thought is to allow the user to specify an arbitrary amount of sound files (by defining the path) in the config file.

Alternativly some of these options could also coexist as command line flags

(note: config format not finalized at all)

[sound]
enable=true
# Could either be a path to an audiofile, an index of the list winsounds or the string 'random', which picks a random file from the list. 
winsound = 0
lostsound = 'random'

#This list is only required if winsound is an index or 'random'
winsounds = [
    "/users/bob/tada.mp3"
    "/users/bob/win.mp3",
    "/users/bob/mario.mp3",
]
#This list is only required if lostsound is an index or 'random'
lostsounds = [
    "/users/bob/error.mp3"
    "/users/bob/lost.mp3",
    "/users/bob/gameover.mp3",
]
Duckapple commented 3 years ago

57 introduces ability for random sounds based on folder structure, meaning we now have 1 or 0 sounds out of the box, and N or 0 sounds if you add new sounds to the win or lose subfolders in resources.

I'm considering closing this issue, as I don't see why we need ability to switch between 0, 1 or N with a flag.

Duckapple commented 3 years ago

Eh, if you want to toggle between 1 and N sounds you'll have to just remove sounds from the folders, or create a new issue so we do it.