University algorithm class assignment is due tomorrow at 1pm. I start working on it at midnight the day of. At around 4-5am I was stumped from a few problems, and went to campus to get some coffee. Tim Horton's doesn't open until 7am. I sit down in a chair and fall asleep.
While I was sleeping (half sleeping?), I dream-solved the remainder of the problems.
At 7am, I awoke, got my coffee, then went to type up the solutions.
I had a really similar experience during college. I was trying to display a binary tree in the command line. I was not able to solve it while awake. I went to bed with that problem in my mind. Then I dreamt the solution. I woke up and the dream made sense. I couldn’t believe it so I tried in the code and it worked! That was a surreal experience.
Dreaming of code is something that happens to me very frequently when I'm working on difficult problems and only the first few times was cool.
Now, when I dream of code, I can hear my inner self saying "no, please! I actually want to rest" because most of the times I feel like I'm in a loop exploring the same solutions over and over.
I've had to get out of bed and do something else so I can go back to sleep without having one of those weird dreams.
Wow. You described my experience exactly! I used to love earlier when I dream solved complex problems, but now I don't like it.
My technique to get good sleep is to fantasize that I am in a spaceship flying through the galaxy or observing Andromeda galaxy. Other times I dream of the Shire and that works too!
I didn't get a perfect grade, but I think the insights did help somewhat. Maybe if I did this 1 day prior and edited my answers, I would have done perfectly :)
University algorithm class assignment is due tomorrow at 1pm. I start working on it at midnight the day of. At around 4-5am I was stumped from a few problems, and went to campus to get some coffee. Tim Horton's doesn't open until 7am. I sit down in a chair and fall asleep.
While I was sleeping (half sleeping?), I dream-solved the remainder of the problems.
At 7am, I awoke, got my coffee, then went to type up the solutions.