Desde el departamento de Definitivamente hay gente que tiene mucho tiempo libre llegan estas 1.900 líneas de código C (y un poquito de ensamblador) para explicar la película Origen como si fuera un programa informático: si se ejecuta el programa, se ve la secuencia de hechos tal y como en la película; examinando el código se puede entender programáticamente lo que en realidad está sucediendo y como se encajan y anidan los sueños. ¡Alerta de sobredosis geek : puede hacer volar unas cuantas neuronas!
Comentarios
¿A que no hay gónadas de hacerlo en COBOL?
#1 Lo de "gónadas" lo dices porque "lo inventaron ellas"? El limpiaparabrisas y mas inventos creados por mentes femeninas
El limpiaparabrisas y mas inventos creados por men...
de10.com.mx#1 Mejor en Prolog.
#1 Como leí por aquí anteriormente, si no existiera C, COBOL solo sería OBOL.
#1 no me toques los goto.... no me toques los goto.
Hace falta más...pum pum
Mi nivel geek es insuficiente para entender esto.
Desde el departamento de Definitivamente hay gente que tiene mucho tiempo libre llegan estas 1.900 líneas de código C...
Mucho tiempo es poco...
Inception (Origen) explicado en lenguaje C
Inception (Origen) explicado en lenguaje C
pisitoenmadrid.com#13 Que veo? Una noticia dentro de otra noticia
desde windows con el compilador de visual studio 9 ni con el de mingw32 compila...
me voy a quedar con ganas de ver que sucede...
#12 Cygwin .
#12 #17 #18 Ni con mingw ni con cygwin se puede. Si os fijáis en el fichero de cabecera, si el sistema no es linux fuerza un error de compilación.
#21 Y como se haría en linux?
#24 Ejecuta "make" y si no da error después "make install". Para ejecutarlo tecleas "/usr/local/bin/inception"
#17 #18 minimo he visto llamadas a la funcion pthread. O linux o nada
#12 Esta escrito usando la bibioteca C de GNU. Para compilarlo en windows necesitas usar CYGWIN
Usease, entras en una pagina que te enseña una fotito con codigo y te dice lo que es. Y si quieres verlo tienes que crearte una cuenta en otra 2º pagina.
Me apuesto que el 99% de los meneantes no lo han ejecutado. (Y si, me invento estadisticas ¿que? todo el mundo lo hace)
#8 Y el 1% de los meneantes no sabe para qué sirve la barra de scroll ni la ruedecita del ratón. Si bajas la página verás que hay un botón que pone Downloads, que como su nombre indica, sirve para bajarte el código fuente sin crearte una cuenta en ningún sitio. Además si bajas un poco más puedes verlo en la misma página pinchando en los enlaces a los ficheros.
#10 Me meto la lengua en el culo respecto a que tienes que hacer una cuenta.
No hace falta hacer scroll para llegar al boton de download.
#8 No hace falta crearse una cuenta en github, puedes ver el código fuente directamente (scrolea un poco hacia abajo)
https://github.com/karthick18/inception/blob/master/inception.c
De todas formas, si eres programador sería muy raro que no tengas ya una cuenta en github, quizás hoy en día el mayor repositorio online de proyectos de software libre y por supuesto de código compartido, en sustitución de sourceforge.
Sobre el meneo, que se puede decir... flipante.
#8 Sí, y eso lo sabe el 84% de la gente
Pero sigue teniendo el mismo fallo de concepción que la película: Si en el Sueño1 (la persecucion del coche) el coche se estrella y empieza a dar vueltas, en Sueño2 (el hotel), se quedan sin gravedad, hasta aquí bien. Pero si en Sueño2 se quedan sin gravedad, ¿en Sueño3(la fortaleza) no deberían estar también sin gravedad?
Problem, Nolan?
#35 Ha sido un mago.
#35 Según como se quieran entender las cosas, la sensación de ingravidad la siente el del primer sueño por cuestiones de cambios de aceleración, pero el del segundo sueño, ¿como sientes que estas "flotando" si estás durmiendo?
Aquí una mejor explicación en inglés
http://www.southparkstudios.com/full-episodes/s14e10-insheeption
Diosantolamadrequelosparió... estamos de coña?!
Y a mí que me faltan horas en el día para hacer cosas que me gustaría hacer. Bueno, supongo que a algunos les gusta hacer este tipo de cosas...
194 menéos... ¿194 descargas del código...? Ni de coña
Ahí tenéis la cura para el cáncer
Arte.
Tenian que haberlo hecho en Java, que es mas portable y las hebras son mas faciles de usar
Y por más que se esfuercen en explicarla, no todo me cuadra. ¡Cojona!
Por cierto, no he mirado el código del que hablan en Microsiervos. Lo digo por si alguien se anima a encontrar inconsistencias y agujeros en la trama
Me pregunto si el codigo tiene tantos agujeros en el guion como la pelicula.
FRIKI!!!
Código descargado, compilado y ejecutado
#9 ¿Y qué sale?
#16
Dreamer [Fischer], level [1], priority [0], policy [OTHER]
Dreamer [Cobb], level [1], priority [0], policy [OTHER]
Dreamer [Yusuf], level [1], priority [0], policy [OTHER]
Dreamer [Ariadne], level [1], priority [0], policy [OTHER]
Dreamer [Arthur], level [1], priority [0], policy [OTHER]
Dreamer [Eames], level [1], priority [0], policy [OTHER]
Dreamer [Saito], level [1], priority [0], policy [OTHER]
[Fischer] HIJACKED ! Open up my defense projections in my dream to the hijackers!
[Yusuf] sees Fischers defense projections at work in the dream at level [1]
[Ariadne] sees Fischers defense projections at work in the dream at level [1]
[Ariadne] following Cobb to level [2]
[Arthur] sees Fischers defense projections at work in the dream at level [1]
[Cobb] sees Fischers defense projections at work in the dream at level [1]
[Cobb] taking Fischer to level 2
[Fischer] following Cobb. to Level [2] to meet his father
[Arthur] follows Cobb. to level 2 to fight Fischers projections
[Saito] sees Fischers defense projections at work in the dream at level [1]
[Yusuf] starts to fall into the bridge while fighting Fischers projections in level [1]
[Eames] sees Fischers defense projections at work in the dream at level [1]
[Eames] faking Browning to manipulate Fischers emotions for the inception at level [1]
[Eames] follows Cobb to level [2] to continue with the manipulation of Fischer
[Saito] shot in level [1]. Following Cobb to level [2]
[Saito] follows Cobb. to level [2] after being shot
Dreamer [Ariadne], level [2], priority [0], policy [OTHER]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
Dreamer [Arthur], level [2], priority [0], policy [OTHER]
Dreamer [Fischer], level [2], priority [0], policy [OTHER]
Dreamer [Cobb], level [2], priority [0], policy [OTHER]
Dreamer [Eames], level [2], priority [0], policy [OTHER]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
Dreamer [Saito], level [2], priority [0], policy [OTHER]
[Ariadne] joining [Arthur] in his dream at level 2 to fight Fischers defense projections
[Eames] Faking Browning's projection to Fischer at level [2]
[Ariadne] joined [Arthur] in level [2]
[Cobb] taking [Fischer] to level 3
[Arthur] Fighting Fischers projections in level [2]
[Ariadne] joining [Cobb] in his dream at level 2 to help Fischer
[Fischer] met with Browning again in level [2]. Waits for Cobb before getting into level [3] to meet his father
[Fischer] following [Cobb] to level [3]
[Cobb] taking [Ariadne] to level 3
[Ariadne] following [Cobb] to level [3]
[Eames] following [Cobb] to level [3]
[Saito] following [Eames] to level [3]
Dreamer [Fischer], level [3], priority [0], policy [OTHER]
Dreamer [Eames], level [3], priority [0], policy [OTHER]
Dreamer [Saito], level [3], priority [0], policy [OTHER]
Dreamer [Ariadne], level [3], priority [0], policy [OTHER]
Dreamer [Cobb], level [3], priority [0], policy [OTHER]
[Cobb] fights [Fischer] defense projections in level [3]
[Cobb] sees his wife [Mal] in his dream. [Mal] shoots Fischer
[Fischer] shot by [Mal] in level [3]
[Eames] sees [Fischer] shot in level [3]. Starts recovery
[Eames] tells [Saito] to keep fighting Fischers projections in level [3]
[Eames] fights Fischers defense projections at level [3]
[Ariadne] sees Fischer shot by Mal in level [3]
[Ariadne] tells [Cobb] to follow Fischer to level [4] in Mal's world in limbo
[Saito] fights Fischers projections in level [3]
[Saito] fights Fischers projections in level [3]
[Eames] doing recovery on [Fischer] who is shot at level [3]
[Saito] gets killed at level [3]. Enters limbo
[Ariadne] enters Limbo at level [4]
[Cobb] follows [Ariadne] and enters limbo with his Wifes projections in level [3]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Ariadne] follows [Cobb] in Elevator to level [4] in Limbo to meet his wife
Cobb takes Elevator to meet Mal in level [4] while in limbo
[Cobb] tells [Mal] about his inception on her to think that the WORLD is unreal in level [4] while in limbo
[Mal] wants [Cobb] to go back with him into the world they built in their dreams in level [4] while in limbo
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Eames] doing recovery on [Fischer] who is shot at level [3]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] experiencing Free fall in level [2] coz of a fall triggered of [Arthur] in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Fischer] interacting with Mr. Browning in hijacked state at level [1]
[Eames] doing recovery on [Fischer] who is shot at level [3]
[Yusuf] while falling into the river triggers Arthurs fall in level [1]
[Arthur] Fighting Fischers projections in level [2]
[Cobb] finds [Mal] killed in level [4] while in limbo
[Ariadne] tells [Cobb] to search for Saito in limbo at level [4]
[Fischer] kicking off from limbo at [4] to level [3]
[Fischer] got a kick back from Limbo at level [3]
[Eames] doing recovery on [Fischer] who is shot at level [3]
[Eames] sees [Fischer] get a recovery kick at level [3]. Starts faking Fischers Father's projections for the final Inception
[Fischer] going to meet his dying father [Maurice Fischer] after getting a kick back to level [3]
[Cobb] enters limbo to search for Saito in limbo at level [4]
[Ariadne] taking the kick back from limbo at level [4] to level [3]
[Ariadne] returned from Fischers limbo to level [3] to take the synchronized kick
[Yusuf] going to take the kick back to reality and wake up all the others through a synchronized kick by effecting the VAN to fall into the river
[Fischer] got a kick at level [3]. Falling back to level [2]
[Eames] doing recovery on [Fischer] who is shot at level [3]
[Eames] got Kick at level [3]. Exiting back to level [2]
[Eames] got Kick at level [2]
[Eames] got Kick at level 1. Exiting back to reality
[Arthur] got Kick at level [2]. Exiting to level [1]
[Arthur] experiencing a FALL in his dream at level [1]
[Arthur] got a Kick at level [1]. Exiting back to reality
[Fischer] got Kick at level [2]. Exiting back to level [1]
[Fischer] got a Kick at level [1].
[Ariadne] got Kick back from level [3]. Exiting back to level [2]
[Ariadne] got KICK while at level [2]. Exiting back to level [1]
[Ariadne] got Kick at level [1]. Exiting back to reality
Cobbs' search for Saito ends in Limbo. Now either both take the kick back to reality or the ending is still a state of limbo from Cobbs' perspective, which is what Nolan wants us to think
This is in spite of witnessing his children turn towards him for the first time which we're never shown in his projections.
So, let me end the limbo state abruptly like the Movie with the totem spinning and leave it to the reviewers to decide the infinite sleep:-)
[Fischer] exiting back to reality from level [1] with the THOUGHT:
Reconcile with my father and have my own individuality
#30 "So, let me end the limbo state abruptly like the Movie with the totem spinning and leave it to the reviewers to decide the infinite sleep:-)"
Ni con el código fuente ejecutado descubro a ciencia cierta si cae o no el totem.
#9 Podrías explicar como compilarlo y ejecutarlo en Windows please?¿
En Python hubiesen sido unas 27 lineas o asi.
Ni COBOL, ni PROLOG, mejor en ASM, jeje, aunque algo hay de ASM en el código, pero parece que es para la validación de la arquitectura de la máquina.
Mirando por encima el código y digo solo por encima, lo que he visto es mucho hilo (uno por nivel de sueños includido el mundo real, tres niveles de sueños y un limbo cada uno con un delay mayor según se baja de nivel) ,semáforos para la exclusión mutua y sincronización entre hilos. En fin mucha programación concurrente y mucho tiempo libre.
No se si cygwin tiene las bibliotecas unistd.h y pthread.h o si funcionarán correctamente en Windows, si las tiene compilará pero que funcionen correctamente lo dudo.
¡Hombre, que coincidencia! Precisamente esta noche he visto 'Origen' y me ha gustado, no como la mierda de 'Memento' que es una mierda enlatada.
Menudo tostón de película, sólo me faltaba encima mirarme el código fuente...