Jabz

433 Reputation

5 Badges

15 years, 292 days

MaplePrimes Activity


These are questions asked by Jabz

Hi all,

The following is my 'poor' attempt at coding the n by n queen problem. I am an amature programmer. The codes individually seem to work fine but when i put it all together it dose not seem to work and it does not produce an error so i don't know where its going wrong.

I would really really appriciate greatly if someone can help me please.

thank you in advance.
 

Hi
 

i am trying to code a proc that tells me when a certain function is better than another. My proc works fine for functions that have a single crossing point but it does not seem to work for inputs that have multiple crossing points.
 


Hi,
I want to shift  the first two elementsof a list to the end and this is what i've coded i have to run the proc twice. Is there a simpler way of doing this??? for example

L:=[1,2,3,4,5]  => [3,4,5,1,2]

switch2:=proc(N)
local y,li:
li:=N:
for y from 1 to nops(li)-1 do
(li[y],li[y+1]):=(li[y+1],li[y])
od:
li;
end proc:

Is there another simpler way of doing this aswell??

L:=[1,2,3,4,5] => [2,1,4,5,3]

switch:=proc(odd)

Is it possible to create a procedure in maple that works out how many 'queens'  can be placed on a board size n * n and plot some sort of a matrix which displays the positions using 1's and 0's without conflicting with each other?? What i mean by 'is it possible' is would it be a efficient algorithm (if it is possible)  or a very long algorithm containing of complex maple code?

Hi i am trying to code a procedure which sorts a list such that the smallest element is the first element and the largest element is the second elemnt then the next smallest element is the third element and the next largest element is the fourth element. For example:

 

L:=[ 2, 3, 5, 2, 7, 9 ]:
 

sorted:= [ 2, 9, 2, 7, 3, 5] :
 

this is what i have coded so far how do i make the process continue??
 

1 2 3 4 5 Page 1 of 5