Use Pascal to make a Rubik s Cube

Updated on Game 2024-05-08
14 answers
  1. Anonymous users2024-02-09

    This method of constructing odd-order magic squares is called Robb's method.

    Program: Program Ex;

    vara: array [1..1000, 1..1000] of longint;

    n, i, j, k, ti, tj: longint;

    beginreadln(n);

    i := 1;

    j := (n + 1) div 2;

    for k:=1 to n * n do

    beginti := i;

    tj := j;

    a[i, j] := k;

    dec(i);

    inc(j);

    if i = 0 then i := n;

    if j > n then j := 1;

    if a[i, j] <0 then

    begini := ti + 1;

    j := tj;

    end;end;

    for i:=1 to n do

    beginfor j:=1 to n dowrite(a[i, j] :5);

    writeln;

    end;end.

  2. Anonymous users2024-02-08

    We just did this the other day.

  3. Anonymous users2024-02-07

    Isn't it just the number of saddles?

    program maths;

    type nbt=array [1..n] of integer;

    vara:array [1..n,1..n] of integer;

    b,c:nbt;

    i,j:integer;

    beginfor i:=1 to n do

    beginfor j:=1 to n do

    read(a[i,j]);

    b[i]:=-32768;

    c[i]:=32767;

    end;for i:=1 to n do

    for j:=1 to n do

    beginif a[i,j]>b[i] then b[i]:=a[i,j];

    if a[j,i]end;

    for i:=1 to n do

    for j:=1 to n do if b[i]=c[j] then write(i,j);

    end.This is my innovative thinking, which is better than the book (self-confession).

    Not bad, isn't it?

  4. Anonymous users2024-02-06

    Description... Input format, output format, and, what is a 4th-order Rubik's Cube?

  5. Anonymous users2024-02-05

    That's it, copy it, give me points.

    program ex;

    var a: array [1..1000, 1..1000] of longint;

    n, i, j, k, ti, tj: longint;

    beginreadln(n);

    i := 1;

    j := (n + 1) div 2;

    for k:=1 to n * n do

    beginti := i;

    tj := j;

    a[i, j] := k;

    dec(i);

    inc(j);

    if i = 0 then i := n;

    if j > n then j := 1;

    if a[i, j] <0 then

    begini := ti + 1;

    j := tj;

    end; end;

    for i:=1 to n do

    beginfor j:=1 to n do

    write(a[i, j] :5);

    writeln;

    end; end.

  6. Anonymous users2024-02-04

    Solution: Possible phalanxes.

    With for loop

    If heng[1]+.heng[3]<>shu[1]..shu[3] then continue;

    Finally, if it meets the requirements of .

    if a[1,1]+a[2,2]+a[3,3]=shu[1]+shu[2]+shu[3] then writeln (phalanx).

  7. Anonymous users2024-02-03

    I haven't tried it yet, though.

    But it shouldn't be possible.

    Secondly, how to restore the Rubik's cube and learn it yourself.

    No programming required. If it's a magic board, it can be programmed.

    Learn the Rubik's Cube and go here: it's very good.

  8. Anonymous users2024-02-02

    The one above is good, but it's too long-winded, look at me for this.

    Play the color of the first layer consistently, and make the color of the side of the first layer the same as the color of the side of the Rubik's Cube 4.

    The second level of formulas: upward straight - right straight - upward reverse - right reverse - upward reverse - forward reverse - upward straight - forward straight.

    The third level of the formula (starting cross): right reverse - upward reverse - forward reverse - upward straight - forward straight - right straight.

    The third layer of the formula (four-corner block): right shun - upward shun - right reverse - upper shun - upper shun 180° - right shun - right inverse.

    The third level of the formula (also four corners): right straight - upward - right reverse - upward reverse - right reverse - forward - right straight 18° - upward reverse - right reverse - upper reverse - right straight - right reverse - forward reversal.

    The third level formula (also centered): right straight - upward reverse - right straight - up straight - right straight - upper shun - right straight - lower reverse - right reverse - upper reverse - right 180°

    Concentrate! :Smooth: Ninety degrees clockwise.

    Inverse: Ninety degrees counterclockwise.

  9. Anonymous users2024-02-01

    I've already made up the ...... with n processesI've been debugged ......Good, sometimes it times out ......Although I can play the Rubik's Cube, the seventh order will ......

  10. Anonymous users2024-01-31

    The Rubik's Cube technique can only be practiced, not spoken.

    You won't understand it if you say so much.

    Let's really practice it yourself.

    I put the 6 sides together and used my brain more.

  11. Anonymous users2024-01-30

    I think there should be far more than 6 types of expansion rules in one step, and there is at least one in between. In addition, I don't know whether to twist left or right within 26 steps. So. It is very likely that the search will be fluttering.

    In addition, I think it should be possible to add some optimization. To make a heuristic, the heuristic function is the difference between the number of blocks and the target. Or get a random...It's good to spell out the character.

  12. Anonymous users2024-01-29

    First of all, it is necessary to clarify how many ways to move the Rubik's Cube

    Take one side facing you Then there are only 6 ways to rotate the front, back, right, left, top, bottom, which all refer to the clockwise rotation of 90°, so that 180° and 270° can also be compounded with these methods, and then search... It has to be violent ... There's no way ...

    In addition, it is better to use a wide search, because there is a mathematician who has proved that any Rubik's cube can be restored in 26 steps Then in the worst case, you only have to try 6 26 possibilities... Of course, this is the worst-case scenario ... If the RP is good, it's still very fast...

  13. Anonymous users2024-01-28

    Upstairs how did it involve the RP problem Sweating

  14. Anonymous users2024-01-27

    This doesn't seem to be simple.,Even if you use search to write, it's a lot of work.,Deep search is easy to die loop.,Wide search state is not good to store.,The landlord looks at the eight digital problems.,That's two-dimensional.,But it's not easy to make it up.。

Related questions
15 answers2024-05-08

This book expounds the principle and production method of the New Gann square diagram; The five functions, five methods and usage guidelines of the new Gann square array are introduced in detail; Combined with the Shanghai and Shenzhen ****** and the trend of **, the practical process, operation points and profit results of using the Xin'en equation diagram are explained in detail. . >>>More

4 answers2024-05-08

The Pascal compilation system is a system software. Pascal is the first structured programming language with rigorous syntax, clear hierarchy, easy to write and readable programs. Pascal language is widely used in various software, and the program is divided into name (self-proposed after program), setting (defined after var), start (begin), program (body), read (read read ln), and end (end), with strong structural hierarchy, rigorous and tight. >>>More

4 answers2024-05-08

varn,i,j:integer;

beginreadln(n); >>>More

4 answers2024-05-08

Second floor. Are you ready to add from 1 to n one by one? >>>More