2 Joke chess puzzles, very nice

It is not legal
I assume you are referring to post #7.
As I understand it, the castling rules were not as strict in the past. As long as a rook has not moved yet. the king can castle with that rook. In the case of an e-pawn promotion, the newly promoted rook has not moved yet (before that it was a pawn so those pawn movements are irrelevant in the consideration). Hence castling with that rook was valid provided the other conditions are also met. Today, the rules that we know include the fact that castling is only allowed with a rook that lies on the same rank as the king, hence castling with a promoted e8 rook is now forbidden.
White to move, mate in 1. No computer program at the moment will be able to find this.
Hint: Think outside the box.

White to move, mate in 1. No computer program at the moment will be able to find this.
Hint: Think outside the box.
Qg9#? It is outside the box

it has to be a or h pawn promotion, but the king will have to move to e8 or the rook will move to a1 ,so it is illegal.Caught you today.
think outside the box,eric0022,like you did in the problem you posted.
The castling rule with the e pawn was not illegal at the time. I am not making this up, you can do a google search on vertical castling. The rules were not that strict then. Unfortunately I was not born yet then.
The rules of castling at the time were that castling could occur if the king and a rook has not moved yet. In the above example, we see that the newly promoted e8 rook has not moved at the time of its 'birth'. Assuming all other conditions are met, the king could castle with the e8 rook, o-o-o-o. The final castled position in this case would comprise an e3 White king and an e2 White rook. No part of the rule suggested that this move was considered illegal at the time since it met all the pre-requisites of castling. To castle in such a manner would be thinking outside the box.
Of course now the rule restricts this to a rook on the starting rank of each player. so castling with a newly promoted e8 rook is illegal.
There are many other rules in the past (now abolished), such as promoting a pawn to a piece of the opponent's colour (promoting a White pawn to a Black knight) and so on.
I found these in Wikipedia under the "Joke chess problem" title. The position of the pawns is unusual, but solving these is nice (the first one is mate in 6, the second one is mate in 8).