Skip to content

Instantly share code, notes, and snippets.

@zku
zku / impossible-game-sharif-ctf-2016.py
Created February 10, 2016 11:51
Solution for the misc challenge "impossible-game", Sharif CTF 2016
#!/usr/bin/env python2.7
# @skusec
'''
Assumption: randomness of the permutations results in cycles of size < 50
(will not always be the case). Start the cycle at the slot we are seeking,
so start at the i-th slot in round i, and hope for the best.
'''
#!/usr/bin/env python
'''
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights