Skip to content

Conversation

@gedabikila-cyber
Copy link

https://docs.github.com/?search-overlay-open=true&search-overlay-ask-ai=true&search-overlay-input=Game%20code
print("--- Crossing the Ocean ---")

print("You are at the edge of the ocean. You see two boats.")

choice = input("Enter (M) for Madagascar boat or (K) for Canary boat: ").upper()

if choice == "M":

print("Go with joy! You found love in Madagascar.")

elif choice == "K":

print("You entered a storm! The boat sank into the water. Game Over.")

else:

print("Invalid choice, you fell into the water!")import random

print("--- Number Guessing Game ---")

secret_number = random.randint(1, 100)

attempts = 0

while True:

try:

    guess = int(input("Guess a number between 1 and 100: "))

    attempts += 1

    

    if guess == secret_number:

        print(f"Very good! You found it in {attempts} attempts.")

        break

    elif guess < secret_number:

        print("Guess a higher number!")

    else:

        print("Guess a lower number!")

        

except ValueError:

    print("Please enter a number only!")

@gedabikila-cyber gedabikila-cyber requested a review from a team as a code owner January 31, 2026 00:02
@gedabikila-cyber
Copy link
Author

package com.example.mygame

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import kotlin.random.Random

class MainActivity : AppCompatActivity() {

// Level 1 = Ocean Game, Level 2 = Number Game
var currentLevel = 1
var secretNumber = Random.nextInt(1, 101)

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    val status = findViewById<TextView>(R.id.statusText)
    val input = findViewById<EditText>(R.id.userInput)
    val btn = findViewById<Button>(R.id.actionButton)

    status.text = "Crossing the Ocean: Choose M or K?"

    btn.setOnClickListener {
        val userValue = input.text.toString().uppercase()

        if (currentLevel == 1) {
            // Ocean Game Logic
            if (userValue == "M") {
                status.text = "Success! Now guess a number (1-100):"
                currentLevel = 2
            } else if (userValue == "K") {
                status.text = "Storm! Game Over. Restart App."
                btn.isEnabled = false
            } else {
                status.text = "Invalid! Choose M or K."
            }
        } else if (currentLevel == 2) {
            // Number Guessing Logic
            val guess = userValue.toIntOrNull()
            if (guess == null) {
                status.text = "Enter a valid number!"
            } else if (guess == secretNumber) {
                status.text = "You Won! You found it!"
            } else if (guess < secretNumber) {
                status.text = "Guess Higher!"
            } else {
                status.text = "Guess Lower!"
            }
        }
        input.text.clear()
    }
}

}

@gedabikila-cyber
Copy link
Author

this is best code
package com.example.mygame

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import kotlin.random.Random

class MainActivity : AppCompatActivity() {

// Level 1 = Ocean Game, Level 2 = Number Game
var currentLevel = 1
var secretNumber = Random.nextInt(1, 101)

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    val status = findViewById<TextView>(R.id.statusText)
    val input = findViewById<EditText>(R.id.userInput)
    val btn = findViewById<Button>(R.id.actionButton)

    status.text = "Crossing the Ocean: Choose M or K?"

    btn.setOnClickListener {
        val userValue = input.text.toString().uppercase()

        if (currentLevel == 1) {
            // Ocean Game Logic
            if (userValue == "M") {
                status.text = "Success! Now guess a number (1-100):"
                currentLevel = 2
            } else if (userValue == "K") {
                status.text = "Storm! Game Over. Restart App."
                btn.isEnabled = false
            } else {
                status.text = "Invalid! Choose M or K."
            }
        } else if (currentLevel == 2) {
            // Number Guessing Logic
            val guess = userValue.toIntOrNull()
            if (guess == null) {
                status.text = "Enter a valid number!"
            } else if (guess == secretNumber) {
                status.text = "You Won! You found it!"
            } else if (guess < secretNumber) {
                status.text = "Guess Higher!"
            } else {
                status.text = "Guess Lower!"
            }
        }
        input.text.clear()
    }
}

}

Copy link
Author

@gedabikila-cyber gedabikila-cyber left a comment

Choose a reason for hiding this comment

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

import com.google.android.gms.ads.rewarded.RewardedAd
import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback

class MainActivity : AppCompatActivity() {
private var rewardedAd: RewardedAd? = null

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    // Beeksisa Video Load gochuu
    val adRequest = AdRequest.Builder().build()
    RewardedAd.load(this, "YOUR_AD_UNIT_ID", adRequest, object : RewardedAdLoadCallback() {
        override fun onAdLoaded(ad: RewardedAd) {
            rewardedAd = ad
        }
    })

    // Button yoo tuqamu video agarsiisuu
    btnShowVideo.setOnClickListener {
        rewardedAd?.show(this) { rewardItem ->
            val rewardAmount = rewardItem.amount
            // Qabxii (Points) nama sanaaf dabali
            userPoints += rewardAmount
            statusText.text = "Points kee: $userPoints"
        }
    }
}

}

@@ -1,4 +1,4 @@
* @actions/actions-runtime
Copy link
Author

Choose a reason for hiding this comment

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

val choices = listOf("ROCK", "PAPER", "SCISSORS")
val computerSelection = choices.random()

btn.setOnClickListener {
val userChoice = input.text.toString().uppercase()

if (userChoice !in choices) {
    status.text = "Please enter Rock, Paper, or Scissors"
} else if (userChoice == computerSelection) {
    status.text = "Draw! Computer also chose $computerSelection"
} else if ((userChoice == "ROCK" && computerSelection == "SCISSORS") ||
           (userChoice == "PAPER" && computerSelection == "ROCK") ||
           (userChoice == "SCISSORS" && computerSelection == "PAPER")) {
    status.text = "You Win! Computer chose $computerSelection"
} else {
    status.text = "You Lose! Computer chose $computerSelection"
}

}

Copy link
Author

Choose a reason for hiding this comment

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

best code 2 5$ dollo money

Copy link
Author

Choose a reason for hiding this comment

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

6 code 10$ dollo money pleas

Copy link
Author

Choose a reason for hiding this comment

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

val roll = (1..6).random()
status.text = "Sabaqni kufe: $roll 🎲"

@@ -1,4 +1,4 @@
* @actions/actions-runtime
https://docs.github.com/?search-overlay-open=true&search-overlay-ask-ai=true&search-overlay-input=Game%20code* @actions/actions-runtime
Copy link
Author

Choose a reason for hiding this comment

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

val secret = (1..100).random()
// Logic: guess == secret (Win), guess < secret (Higher), guess > secret (Lower)

Copy link
Author

Choose a reason for hiding this comment

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

val options = listOf("Rock", "Paper", "Scissors")
val ai = options.random()
// Logic: If user == ai (Draw), else check who wins.

Copy link
Author

Choose a reason for hiding this comment

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

val fortunes = listOf("Guyyaa gaarii!", "Maallaqa argatta", "Of eeggannoo godhi", "Hiriyaan haaraa ni dhufa")
status.text = fortunes.random()

@@ -1,4 +1,4 @@
* @actions/actions-runtime
https://docs.github.com/?search-overlay-open=true&search-overlay-ask-ai=true&search-overlay-input=Game%20code* @actions/actions-runtime

Copy link
Author

Choose a reason for hiding this comment

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

val num1 = (1..10).random()
val num2 = (1..10).random()
val answer = num1 + num2
status.text = "$num1 + $num2 = ?"

* @actions/actions-runtime
https://docs.github.com/?search-overlay-open=true&search-overlay-ask-ai=true&search-overlay-input=Game%20code* @actions/actions-runtime

/packages/artifact/ @actions/artifacts-actions
Copy link
Author

Choose a reason for hiding this comment

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

val lottoNumbers = List(6) { (1..49).random() }
status.text = "Lottoo guyyaa har'aa: ${lottoNumbers.joinToString(", ")}"

Copy link
Author

Choose a reason for hiding this comment

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

// Chapa API fayyadamuun kaffaltii eegalchiisuu (Example)
val paymentRequest = JSONObject().apply {
put("amount", "100") // Birrii 100
put("currency", "ETB")
put("email", "user@example.com")
put("tx_ref", "unique_transaction_id_123")
}

// Koodii kanaan gara 'Payment Gateway' tti qajeelchita
fun startPayment(request: JSONObject) {
// API Call to Chapa or Telebirr
println("Kaffaltiin eegalameera: ${request.get("amount")} ETB")
}

https://docs.github.com/?search-overlay-open=true&search-overlay-ask-ai=true&search-overlay-input=Game%20code* @actions/actions-runtime

/packages/artifact/ @actions/artifacts-actions
/packages/cache/ @actions/actions-cache
Copy link
Author

Choose a reason for hiding this comment

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

import com.google.android.gms.ads.rewarded.RewardedAd
import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback

class MainActivity : AppCompatActivity() {
private var rewardedAd: RewardedAd? = null

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    // Beeksisa Video Load gochuu
    val adRequest = AdRequest.Builder().build()
    RewardedAd.load(this, "YOUR_AD_UNIT_ID", adRequest, object : RewardedAdLoadCallback() {
        override fun onAdLoaded(ad: RewardedAd) {
            rewardedAd = ad
        }
    })

    // Button yoo tuqamu video agarsiisuu
    btnShowVideo.setOnClickListener {
        rewardedAd?.show(this) { rewardItem ->
            val rewardAmount = rewardItem.amount
            // Qabxii (Points) nama sanaaf dabali
            userPoints += rewardAmount
            statusText.text = "Points kee: $userPoints"
        }
    }
}

}

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.

1 participant