Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:01:20+00:00 2026-06-10T11:01:20+00:00

if(loopCount % (20 – loopCount / 100) == 0) { if(dropBlock() == false) {

  • 0
        if(loopCount % (20 - loopCount / 100) == 0) {
            if(dropBlock() == false) {
                mode = -1;
                loopCount = 1;
            }
            if(loopCount == 1900)
                loopCount--;
        }
        loopCount++;

A tetris program from a book written by java. I just can’t understand why using such a piece of code to control the droping speed of a block and how it works.
Thank you !

The initial value of loopCount is 1 and dropBlock will return false if the game ends. This piece is contained in the main loop. And the mode is not relevant. I am sorry but I just can’t gvie the whole program here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:01:21+00:00Added an answer on June 10, 2026 at 11:01 am

    It appears that it is set to have loopcount start at one, and lets use a table to examine the effect of if(loopCount % (20 - loopCount / 100) == 0) {

    loopCount < 100, loopCount/100 = 0, so loopCount % 20 returns true for 20, 40, 60 and 80. Lets say loopCount is 100 – 199. Now we’re checking if it’s divisible by 19, for 200-300 divisible by 18. I’m not sure what exactly he is trying to achieve with this though. Then it checks if it fails to drop the block maybe, (dropBlock possibly tried to drop the block, and returns true for success, false for failure. Then if it fails it sets mode to -1 (maybe exits?). Then once loopCount reaches 1900, it prevents it from going up (by decreasing to 1899 right before the loopCount++;, which essentially decreased then increases, so does nothing (holding it at 1900)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning about threading and multithreading..so i just created a small application in
I am currently working on a minesweeper program and i need a little help
Before you react from the gut, as I did initially, read the whole question
I am creating an android game where enemies are generated randomly and there can
What can I do if I want to have a text-box representing in real
I have a small utility script written as .Net/C# console app purely for the
I have two tables: Holdings and Transactions Holdings data looks like: 06/30/2009, A, 100
I wrote a little program to calculate the first 18 triples (x,y,z) with x<y<z
Wondering what a continue statement does in a do...while(false) loop, I mocked up a
I'm calling a page method with jquery and it works just fine. I'm creating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.