brian bovril

904 Reputation

16 Badges

18 years, 94 days

MaplePrimes Activity


These are questions asked by brian bovril

Hi. I'm comparing two 7x3-man teams lists. I can see there are at least 2 teams that have common members, new[1] and past[4], new[4] and past[3]. There may be others but the chat gpt code below doesn't definitively find any of them.

common.mw

Hi

A padel group organises doubles tournaments with the following structure: 16 players participate in four rounds, with each round consisting of four doubles matches. Players switch partners after each round.

So what I require is some code to generate the first round matches, the second round, the third, the nth .....

note the worksheet I bastardised from Tom Leslie's work. 

2_man_teams_doubles.mw

Hi

My third-party soft is fussy: it will only accept pasted plaintext, with no spaces in between, for example:

1407,1411,2,1408,1409,0
1407,1408,2,1409,1411,0

#My input is 
ans1 := [1407, 1408, 2, 1409, 1411, 0], [1407, 1409, 2, 1408, 1411, 0], [1407, 1411, 2, 1408, 1409, 0];

#I am "trying" to remove the whitespace and convert it to plain text

with(StringTools):
for i to 3 do
seq(parse(DeleteSpace(convert(ans1[i][j],string))),j=1..6);
next i
od;

#But the whitespace is still there....

lprint(%%%);lprint(%%);lprint(%)
ans1 := [1407, 1408, 2, 1409, 1411, 0], 

  [1407, 1409, 2, 1408, 1411, 0], [1407, 1411, 2, 1408, 1409, 0]


                  1407, 1408, 2, 1409, 1411, 0

                  1407, 1409, 2, 1408, 1411, 0

                  1407, 1411, 2, 1408, 1409, 0

Hi

I'm trying to automate this production of doubles combinations with a set scoreline in between. The minimum is 4 players, but we could have many more players, producing many combinations. 

example: 4 players, set score 2-0 for each match

with(combinat):
DBL:=choose([Novice,Weak_Intermediate,Strong_Intermediate,Advanced], 2);
DBL[1],2,DBL[6],0;DBL[2],2,DBL[5],0;DBL[3],2,DBL[4],0

#and the reverse
DBL[6],2,DBL[1],0;DBL[5],2,DBL[2],0;DBL[4],2,DBL[3],0
 

#the output contains square brackets. How do I remove them?

Hi

I wanted to know how to search a list of permutations given criteria: print the permutation(s) If the 4th element of each perm was equal to [C,Z} and the seventh was equal to [B,Y]

perm.mw

1 2 3 4 5 6 7 Last Page 1 of 34