Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

pottersheep

Java - tetris code explanation please?

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. pottersheep
    Best Response
    You've already chosen the best response.
    Medals 1

    I need a code for rotating the blocks but I have no idea how ! >.< I found this example on the internet: int items[]={ 0,0, -1,0, 0,-1, -1,-1, // cube, normal 0,0, -1,0, 0,1, -1,1, // rotated 90 degrees 0,0, 1,0, 0,1, 1,1, // rotated 180 degrees 0,0, 1,0, 0,-1, 1,-1, // rotated 270 degrees 0,0, 0,-1, 0,-2, 0,-3, // straight line 0,0, -1,0, -2,0, -3,0, 0,0, 0,1, 0,2, 0,3, 0,0, 1,0, 2,0, 3,0, 0,0, 1,0, 0,-1, -1,-1, // stupid block 0,0, 0,-1, -1,0, -1, 1, 0,0, -1,0, 0,1, 1,1, 0,0, 0,1, 1,0, 1,-1, 0,0, -1,0, 0,-1, 1,-1, // stupid block 2 0,0, 0,1, -1,0, -1,-1, 0,0, 1,0, 0,1, -1,1, 0,0, 0,-1, 1,0, 1,1, 0,0, 1,0, -1,0, 0,-1, // another one 0,0, 0,1, 0,-1, -1,0, 0,0, 0,1, -1,0, 1,0, 0,0, 1,0, 0,-1, 0,1, 0,0, 0,-1, 1,-1, 0,1, // hook one 0,0, -1,0, -1,-1, 1,0, 0,0, -1,1, 0,1, 0,-1, 0,0, -1,0, 1,0, 1,1, 0,0, 0,1, 0,-1, -1,-1, // hook two 0,0, 1,0, -1,0, -1,1, 0,0, 0,-1, 0,1, 1,1, 0,0, -1,0, 1,0, 1,-1 }; int checks[]={ -1,1, 0,1, -1,1, 0,1, // check cube, normal -1,2, 0,2, -1,2, 0,2, // check, rotated 90 degrees 0,2, 1,2, 0,2, 1,2, // check, rotated 180 degrees 0,1, 1,1, 0,1, 1,1, // check, rotated 270 degrees 0,1, 0,1, 0,1, 0,1, 0,1, -1,1, -2,1, -3,1, 0,4, 0,4, 0,4, 0,4, // straight line 0,1, 1,1, 2,1, 3,1, 0,1, -1,0, 1,1, 0,1, // stupid block one 0,1, -1,2, 0,1, -1,2, 0,2, 1,2, -1,2, 0,2, 0,2, 1,1, 0,2, 1,1, -1,1, 0,1, 1,0, 1,0, // stupid block two -1,1, 0,2, 0,2, -1,1, -1,2, 0,2, 1,1, 1,1, 0,1, 1,2, 0,1, 1,2, -1,1, 0,1, 1,1, 1,1, // block three -1,1, 0,2, 0,2, -1,1, -1,1, 0,2, 1,1, 1,1, 0,2, 1,1, 0,2, 1,1, 0,2, 1,0, 1,0, 0,2, // hook one -1,1, 0,1, 1,1, 1,1, -1,2, 0,2, 0,2, -1,2, -1,1, 0,1, 1,2, 1,2, -1,0, 0,2, 0,2, -1,0, // hook two -1,2, 0,1, 1,1, 1,1, 0,2, 1,2, 1,2, 0,2, -1,1, 0,1, 1,1, 1,1 };

    • 2 years ago
  2. pottersheep
    Best Response
    You've already chosen the best response.
    Medals 1

    Can someone please explain the code for me please? why is there a list of coordinates? Is that an array or something? MY TEACHERS MAKING ME DO THE IMPOSSIBLE IVE ONLY BEEN STUDYING COMPUTER SCIENCE FROM SCRATCH SINCE OCTOBER HOW THE HELL DO I PROGRAM TETRIS I BARELY CAN MAKE A CALCULATOR PANICCCCCCCCCC

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.