smartcontracts – Simple, standard "Hello World" smart contract for an auction? (the winner wins, the rest will be refunded)

I recently read an article:

Due to many of Ethereum's central marketing measures, there is a false assumption that smart contracts only exist in Ethereum. That is not true. Bitcoin had a fairly extensive, intelligent contract language called Script from the beginning of 2009.

Enter image description here

If Bitcoin has smart contracts, I'd like to see how to create a simple "hello world" auction – winners win, those who haven't won will be refunded.

(I heard RSK is EVM compatible, but that's more involved)

Algorithms – Thirty One Game. Prediction of the winner

I'm having a problem creating an algorithm to predict a winner from thirty-one games.

Players from a deck of cards take the ace, 2, 3, 4, 5 and 6 of each suit. These 24 cards are placed face up on a table. The players alternately flip cards over and the sum of the flipped cards is calculated over the course of the game. Each ace counts as one.
The only limit is the total value of the stacked cards: it cannot exceed 31. The player who cannot make a move loses.

It is my job to determine the winner of the game based on the deck of cards set aside. We assume that both players play perfectly.

For example:

356656 means gameplay: player A discards 3, player B discards 5, player A discards 6, player B discards 6, player A discards 5, finally player B discards 6 and wins because player A cannot make a move.

356656 -> winner B
35665 -> winner B
3566 -> winner A
111126666 -> winner A
552525 -> winner A
2 -> winner A

Algorithms – Finding a Winner in a "Long List"

This is a betting domain that contains a long list: a list of markets for "home wins / draws / away wins" for 13 games.
A punter can select any combination of the possible results, which are coded as follows:

1 - home team wins
2 - draw
4 - away team wins
3 - home team wins or draw
5 - home team wins or away team wins
6 - draw or away team wins
7 - home team wins or draw or away team wins

Meaning a [3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7] Represents a selection where Punter places the following bets:

  • "Home team wins or draw" in a first game
  • "Home team wins" in games 2-12
  • "Home team wins or draw or away team wins" in the 13th game

After the games are over, there will be another list of 13 items that represent the winning results, for example: [4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] means that the away team won in a first game and the home team won in all other games.

The question is whether I miss any properties within these numbers that make finding a winning bet easier than comparing the individual numbers one by one. As in our case, we check for bets 4.5. 6 or 7 for the first game and 1. 3. 5 or 7 for the rest of them.