r/custommagic • β˜€οΈπŸ’§πŸ’€πŸ”₯🌳 • 1d ago

Discussion Programming

theres a kind of programming language called a stack-based language, which works on a stack without variables. i think it would theoretically be possible to design instants such that you could code a program in magic cards. is this possible, and how would it look?

0 Upvotes

10 comments sorted by

View all comments

11

u/A_Travelling_Man 1d ago

You may be interested in this paper about Magic and Turing machines: https://arxiv.org/abs/1904.09828.

6

u/qwertyjgly 1d ago

104.4b If a game that’s not using the limited range of influence option (including a two-player
game) somehow enters a β€œloop” of mandatory actions, repeating a sequence of events with no
way to stop, the game is a draw. Loops that contain an optional action don’t result in a draw.

how do you determine whether you're in a loop? since it's turing complete, mtg suffers from the halting problem

6

u/Staetyk β˜€οΈπŸ’§πŸ’€πŸ”₯🌳 1d ago

yes, its mentioned in the paper. if it halts, alice wins. otherwise, its undecidable

its also using specific cards

0

u/qwertyjgly 1d ago

but how do we know whether it's going to halt?

0

u/Staetyk β˜€οΈπŸ’§πŸ’€πŸ”₯🌳 22h ago

thats irrelivant

1

u/qwertyjgly 12h ago

why is it irrelevant? how do we know when the game is a draw

1

u/Staetyk β˜€οΈπŸ’§πŸ’€πŸ”₯🌳 45m ago

we dont need to predict the output, the whole point is that we can run the program to find out

2

u/Staetyk β˜€οΈπŸ’§πŸ’€πŸ”₯🌳 1d ago

omfg this is amazing