Why does Min-Max algorithm delays a good move indefinitely?

I implemented a min-max algorithm for a game and discovered a problem.

Let’s say there is a 2×2 grid:

.. .. 

Assume we start at location (0, 0) and the target is (1, 1):

S. .T 

Moves allowed: adjacent or diagonal move.

Evaluation: if I land at (1, 1), I get +100.

If I implement the mini-max algorithm for this with depth 1, some of the branches are as follows:

(0, 0) -> (0, 1) -> (1, 1) Here, we return +100

(0, 0) -> (1, 0) -> (1, 1) Here, we return +100

(0, 0) -> (1, 1) -> (0, 1) Here, we return +0

If you look at this, the algorithm should actually play the 3rd branch and immediately go to (1, 1) but rather it would select 1st or 2nd branch. And after playing that move it will again go into the same situation and continue to select branches that have (1, 1) as the 2nd step.

How to solve this problem? My game has entered a kind of an infinite situation where it is just playing another move with the hope of playing good move at depth 1 but again does the same process and repeats this infinitely.

Wait Command so Unrar will finish the first .rar then move to next

Below is the command user3140225 helped me out with and it works fine:

find /home/username/source/directory/ -type f -name "*.rar" -exec unrar e -o- {} /home/username/copy/extracted/to \; -delete && rm -r /home/username/source/directory 

Except I noticed it is uraring the .rar files from the separate folders (Folder1, 2) all at one time.

My structure is

  • SourceDirectory


    File .rar


    File .rar

I would like the one unrar to finish first before it goes on to the next one.

I am using cronjobs to run these commands. So if there is another way I would be grateful.

Can you move while Hidden?

Assuming you have successfully Hidden, can you:

  1. Continue to be not ‘clearly visible’ while moving and remain Hidden.
  2. Become ‘clearly visible’ while moving and remain Hidden.

In the Stealth section it says:

Make a Dexterity (Stealth) check when you attempt to conceal yourself from enemies, slink past guards, slip away without being noticed, or sneak up on someone without being seen or heard.

So you can definitely move unseen with a Stealth action, but is that allowed in the Hide action?


Until you are discovered or you stop hiding, that check’s total is contested by the Wisdom (Perception) check of any creature that actively searches for signs of your presence.

You can’t hide from a creature that can see you clearly, and you give away your position if you make noise, such as shouting a warning or knocking over a vase.

Passive Perception. When you hide, there’s a chance someone will notice you even if they aren’t searching. To determine whether such a creature notices you, the DM compares your Dexterity (Stealth) check with that creature’s passive Wisdom (Perception) score

The rules clearly state that in order to hide you only need to be ‘not clearly seen’ and it is successful if you beat the opponent’s Passive Perception. Your position is given away if you make noise (although you are not revealed). If an opponent takes the Search action to make a Perception check and beats your Stealth roll then you are discovered.

So the Hide action is a Stealth roll contested by Passive Perception. Creatures can contest the roll with the Search action using their Perception. Unless a creature opts to no longer be hidden, this is the only ways they can be revealed?

This seems to indicate that moving has no bearing on remaining hidden.

Move Content Type from one Site Collection to another Site Collection

I have a custom content type “Employee” that inherits from the “Document Set” content type. It has metadata attached to it as well and it resides in a document library.

I would like to create a script to move the “Employee” content type from Document Library A in Site Collection A to Document Library B in Site Collection B.

I would like for all the metadata to stay in tact as well as all the folders and files that live under the Document Set.

Is this possible in SharePoint Online?

how do i move all files from one folder to another in terminal

I have searched various forums with variations on the question –

I am trying to move all files including those in sub folders from one folder to another – just the files not the folders.

This command works for directories

find ~/Desktop/ -type f -print0 | xargs -0 mv -t ~/Videos 

but this command I tried for folders does not

find ~/Desktop/Folder1/ -type f -print0 | xargs -0 mv -t ~/Videos/Folder2 

If A completed move to B, and if B completed move to C

The scenario I have written supposed to work like below…

A has 4 multiple choice options, (Completed, Suspended, Blocked, Cancelled)

B has 4 multiple choice options (Completed, Suspended, Blocked, Cancelled)

The same for C and D.

If A is completed then only B can be chosen (any value) and if the user selects B as completed, then C can be selected (any value) and other columns will not be able to be chosen. I have spent many scenarios but none of them seem to be work, some function such as only if all are completed, you can submit it. I would appreciate, if someone corrects my expression I have written below. Thanks beforehand.





(OR( (AND([B]=”completed”;[C]<>””)); (AND([B]<>””;[C]<>””)); ) ); );


Does a Stone Giant get an attack of opportunity if I move only 5 feet away from it?

It reads in the PHB (p.195)

You can make an opportunity attack when a hostile creature that you can see moves out of your reach.

For a creature who has no melee attacks with only a 5 ft. reach, such as a stone Giant whose Greatclub attack has a reach of 15 ft., would it get an attack of opportunity on me if I move 5 ft. away from a position adjacent to it?