A much more elegant way (I believe) is to have it in software as an Android / iOS app. There are quite a few apps that force you to solve a simple math question / puzzle. You could always put your phone somewhere away from your bed.
At one point, I was working on an alarm app that had some game mechanics built into it (points for waking up on time, waking up on time for 5 days in a row, waking up before 6am etc.) and had various types of puzzles to turn off the alarm. I gave up on it because I decided it was more of a sleeping habit issue than an inability to wake up. You can't consistently sleep at 2 in the night and expect to wake up by 6 in the morning ..
At one point, as an alarm clock, I had a headless box under my bed that would play loud music. To turn it off, I had to ssh into it from my laptop - and the password was extremely long.
Ultimately, the long password wasn't enough to "wake me up," and by then I had a smartphone, so I got an Android app that made me solve math puzzles to turn off the alarm.
Ultimately ultimately, I realized that it was really a behavioral problem. Now I just get up when my alarm goes off. :)
(That makes it sound like the "behavioral" solution was simple, but believe me, it was extremely far from simple. And I still think the product being advertised here is an extremely cool idea and potentially very useful.)
At one point, I was working on an alarm app that had some game mechanics built into it (points for waking up on time, waking up on time for 5 days in a row, waking up before 6am etc.) and had various types of puzzles to turn off the alarm. I gave up on it because I decided it was more of a sleeping habit issue than an inability to wake up. You can't consistently sleep at 2 in the night and expect to wake up by 6 in the morning ..