Which anime it is? (from description)
Imawa no Kuni no Alice
I haven't seen the anime, but what you describe is more or less the same as the first chapters of the manga going by the same name.
Synopsis from MyAnimeList:


The story follows a high school boy named Arisu and other youths who are transported to a devastated alternate world. Trapped, they are forced to play a deadly game of survival.