Skip to content

New challenges: multiplication shortcuts (x 9, x 11, x 99, near round numbers) - #298

Merged
msbelaid merged 3 commits into
msbelaid:masterfrom
jay23606:pr-go/277-new-challenge-multiplication-shortcuts-1
Nov 23, 2026
Merged

msbelaid merged 3 commits into
msbelaid:masterfrom
jay23606:pr-go/277-new-challenge-multiplication-shortcuts-1

Conversation

@jay23606

@jay23606 jay23606 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the five multiplication shortcut challenges requested in #277:

Class Example Level
MultiplicationSingleDigitByNineChallenge 9 x 7 5
MultiplicationTwoDigitByElevenChallenge 11 x 43 7
MultiplicationSingleDigitByNinetyNineChallenge 6 x 99 7
MultiplicationSingleDigitByNumberEndingInNineChallenge 6 x 19, 8 x 49 8
MultiplicationTwoDigitByElevenToNineteenChallenge 14 x 23 11

All operands are positive, so every answer is a whole number. Each class is registered in ChallengesModule.kt.

Generic multiplication challenges now avoid generating the same shortcut patterns: single-digit products omit 9, single-by-double-digit products omit two-digit factors ending in 9, and double-by-double-digit products omit factors from 11 through 19.

Tests

The new challenge tests check difficulty, operand ranges, and answers. The generic multiplication range tests now sample 100 instances to verify the shortcut exclusions.

These commands passed on the initial implementation head 20602fd:

  • ./gradlew.bat :challenges:test --tests "app.plugbrain.android.challenges.MultiplicationShortcutsChallengeTest" --tests "app.plugbrain.android.challenges.MultiplicationChallengeTest" --offline
  • ./gradlew.bat :challenges:ktlintCheck :app:ktlintCheck --offline

I could not rerun Gradle for the follow-up commit locally: the offline cache is missing org.gradle.kotlin.kotlin-dsl:5.2.0. CI will validate the updated range tests on the current head. Detekt and the full ./gradlew test suite were not run locally.

Fixes #277

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

APK size

Release APK
master 4.05 MB
this PR 4.05 MB (+0.0 KB, +0.00%)

Release build signed with the CI test key, at cc1fbfe.

@msbelaid msbelaid left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, I think we can exclude these shortcuts from the other generic challenges!

@jay23606
jay23606 force-pushed the pr-go/277-new-challenge-multiplication-shortcuts-1 branch from e6f4df5 to c1ea132 Compare November 17, 2026 21:14
@msbelaid msbelaid mentioned this pull request Nov 19, 2026
2 tasks done
override val operand1: Int = (3..9).minus(5).random()
override val operand2: Int = (3..9).minus(5).random()
override val operand1: Int = (3..9).minus(listOf(5, 9)).random()
override val operand2: Int = (3..9).minus(listOf(5, 9)).random()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we replace it with listOf(3, 4, 6, 7, 8)

Suggested change
override val operand2: Int = (3..9).minus(listOf(5, 9)).random()
override val operand1: Int = (3, 4, 6, 7, 8).random()
override val operand2: Int = (3, 4, 6, 7, 8).random()

@msbelaid
msbelaid merged commit 1182ca6 into msbelaid:master Nov 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New challenge: multiplication shortcuts (× 11, × 9, × 99, near round numbers)

2 participants