S
S
stepan-neretin72021-02-24 06:34:56
IT education
stepan-neretin7, 2021-02-24 06:34:56

How to code game theory?

Hey guys. There are tasks of this type for game theory at the Unified State Exam in computer science.
6035c8b383c8b754702062.jpeg

6035c8b9d1f4b384034053.jpeg

Since this year's exam is the first to be held in computer form, the idea was to code it.
Who can tell how beautifully it is possible to code this kind of template tasks in order to immediately receive answers to the questions posed .. It is not difficult to generate a game tree, but to come up with an idea for a universal code so that you can answer questions like "Vanya will win by 2 moves after Petya's unsuccessful move" or "Vanya will win either by 3 or 2 moves"... Who can have any ideas how it can be done beautifully.. I would be grateful for any idea

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
Griboks, 2021-02-24
@Griboks

This is a normal state machine. You can generate a table in which to draw transitional arrows between cells. Then just put your finger on the original cell and move along the arrows.
ps
Of course, it's better to use a stupid formula.

S
Stalker_RED, 2017-11-03
@PHPjedi

I hope you have a single point of entry.
Register your error handler .
You wrap your entire application in try...catch.
When an error occurs, your handler is automatically called, and you can display a beautiful "oh, everything is broken" stub, while you can get a stack trace and write it beautifully to the log.

V
Vadim Vadim, 2017-11-03
@defoltt

When manipulating the database, use try catch

K
Kirill Nesmeyanov, 2017-11-03
@SerafimArts

php.net/manual/en/language.exceptions.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question