Get some sleep, at your age I was running on 0 - 2h sleep a day for many months at a time, with maybe a weekend of normal sleeping in between before doing it again for many more months and following this lifestyle for almost 5 years.
During those 5 years I eventually shifted into an extreme form of Polyphasic/Uberman sleep in order to make it through each day.
Keep up the no-sleep thing for too many years and it will affect your ability to write complicated code as your mind will permanently be clouded until you start catching up on that missed sleep and as you get older you might develop medical complications as a result of not sleeping enough.
As an example, I tried to work for 7 days straight and not sleep at all, by the time I got to day 7, it felt like I was on some sort of hallucinogenic drug that caused me to jump between fever and being cold, seeing things, hearing voices, talking to people that's not there, severe sugar cravings, completely messing up my sense of time with random blackouts of which I couldn't remember anything, but still wrote code during those times I was blacked out. etc.
My friend who did the same project finished it in 5 days while sleeping 8-10 hours a day whereas I battled through 7 days of misery and just barely finished the project.
So tldr; get some sleep, you'll write better code if you do.