Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2023, 10:06 PM
leeqiang leeqiang is offline How to automatically generate the process node code of the competition based on this game rule? Windows 10 How to automatically generate the process node code of the competition based on this game rule? Office 2019
Advanced Beginner
How to automatically generate the process node code of the competition based on this game rule?
 
Join Date: Aug 2020
Posts: 53
leeqiang is on a distinguished road
Default How to automatically generate the process node code of the competition based on this game rule?

Question:



Game Rules:

A, B, and C students will participate in a badminton competition, and the agreed format is as follows:

Those who have accumulated two losses are eliminated;

Draw lots before the competition to determine the first two contestants, with the other person taking turns;

The winner of each game will play the next game with the vacant player, and the loser will be left in the next game until one player is eliminated;

After one person is eliminated, the remaining two people continue to compete until one person is eliminated and the other person ultimately wins, ending the competition

After drawing lots, Party A and Party B will compete first, while Party C will take turns.

Let's assume that the probability of both sides winning in each game is 1/2

The tree view is roughly as follows


微信图片_20230710090549.jpg


The manually drawn tree view is shown above:As shown in the above figure, the two letters of each node represent the names of the opponents on both sides of the competition. For example, AB means that both parties in this competition are A and B. The letters and numbers on each branch line indicate that a participant's result in this competition is a loss, and the numbers represent the cumulative number of losses. For example, A1, the loser after this competition is A, with a cumulative loss of one. C2 indicates that the loser in this competition is C, who has lost 2 times and is eliminated.


.jpg

But I want to use VBA to implement the six digit number in the node shown in the figure above. There are three people named ABC, and I use the six digit number to represent the process and final result of all competitions. The first two digits before and after the six digits represent the number of times A wins and the number of times A loses, respectively. The middle two digits before and after the six digits represent the number of times B wins and the number of times B loses, respectively. The last two digits before and after the six digits represent the number of times C wins and the number of times C loses, respectively.


For example, 000000 represents a situation where there is no competition to start. 101000 means A wins once, B wins once, and C has not yet participated. 100100 means A wins once, B loses once, and C does not participate. 021001 means A loses twice, B wins once, C loses once, and so on.

How to automatically generate all six digit numbers for the pre competition process based on the above game rules

2023-07-10_130343.png

The generated effect is similar to the above image. It is best to group the numbers in pairs, that is, the relationship between the previous matches is generated in all situations, according to the game rules and in groups of two
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to generate an open items list automatically? reene11 Word 1 04-09-2022 07:42 AM
Generate QR Code in Word 2010 pacojones Word 4 11-03-2020 12:28 PM
How to automatically generate the process node code of the competition based on this game rule? Setting ".Text" value of XML Attribute Node Changes Node Index Order??? gmaxey Word VBA 1 07-14-2019 11:48 AM
How to automatically generate the process node code of the competition based on this game rule? Automatically generate PDF from saved word doc JamesHusband Word 3 06-07-2014 08:30 AM
How to automatically generate the process node code of the competition based on this game rule? Generate sequential code tags ssarank Word VBA 3 12-25-2013 02:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft