Ad placement

Friday, December 20, 2024

donations

import React, { useState } from 'react';
import { Coffee, Heart, Star, Trophy } from 'lucide-react';
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { Alert, AlertDescription } from '@/components/ui/alert';

const SupportComponent = () => {
  const [selectedTier, setSelectedTier] = useState(null);
  const [showThankYou, setShowThankYou] = useState(false);

  const tiers = [
    {
      name: 'Coffee',
      amount: 5,
      description: 'Buy me a coffee to keep me going!',
      icon: Coffee,
      color: 'text-orange-500'
    },
    {
      name: 'Supporter',
      amount: 10,
      description: 'Support my work and get a special thank you!',
      icon: Heart,
      color: 'text-pink-500'
    },
    {
      name: 'Star',
      amount: 25,
      description: 'Become a star supporter with exclusive updates!',
      icon: Star,
      color: 'text-yellow-500'
    },
    {
      name: 'Premium',
      amount: 50,
      description: 'Premium supporter with priority access to new content!',
      icon: Trophy,
      color: 'text-purple-500'
    }
  ];

  const handleSupport = (tier) => {
    setSelectedTier(tier);
    // Here you would integrate with your payment processor
    // For example: stripe.redirectToCheckout({ ... })
    setShowThankYou(true);
  };

  return (
    <div className="max-w-4xl mx-auto p-4">
      <div className="text-center mb-8">
        <h2 className="text-3xl font-bold mb-4">Support My Work</h2>
        <p className="text-lg text-gray-600">
          If you find my content valuable, consider supporting me to help create more amazing resources!
        </p>
      </div>

      {showThankYou && (
        <Alert className="mb-6 bg-green-50">
          <AlertDescription className="text-green-800">
            Thank you for your support! You're amazing! 🎉
          </AlertDescription>
        </Alert>
      )}

      <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
        {tiers.map((tier) => (
          <Card key={tier.name} className="flex flex-col">
            <CardHeader>
              <div className="flex items-center justify-center mb-4">
                <tier.icon className={`w-12 h-12 ${tier.color}`} />
              </div>
              <CardTitle className="text-center">{tier.name}</CardTitle>
              <CardDescription className="text-center text-2xl font-bold">
                ${tier.amount}
              </CardDescription>
            </CardHeader>
            <CardContent className="flex-grow">
              <p className="text-center text-gray-600">{tier.description}</p>
            </CardContent>
            <CardFooter className="flex justify-center">
              <Button 
                onClick={() => handleSupport(tier)}
                className="w-full bg-blue-600 hover:bg-blue-700 text-white"
              >
                Support with ${tier.amount}
              </Button>
            </CardFooter>
          </Card>
        ))}
      </div>
    </div>
  );
};

export default SupportComponent;

Thursday, October 17, 2024

SteampunkRPG

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Steampunk JRPG</title>
    <style>
        body {
            background-color: #2e2e2e;
            color: #d3b17d;
            font-family: 'Verdana', sans-serif;
            margin: 0;
            padding: 0;
        }
        #game {
            width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        #output {
            border: 1px solid #d3b17d;
            padding: 10px;
            height: 400px;
            overflow-y: scroll;
            background-color: #1e1e1e;
        }
        #input {
            margin-top: 10px;
        }
        button {
            background-color: #d3b17d;
            border: none;
            padding: 10px;
            margin: 5px;
            cursor: pointer;
            color: #2e2e2e;
        }
        button:hover {
            background-color: #b39465;
        }
    </style>
</head>
<body>
    <div id="game">
        <h1>Steampunk Adventure</h1>
        <div id="output"></div>
        <div id="input"></div>
    </div>
    <script>
        // Game variables
        let player = {
            name: 'Adventurer',
            level: 1,
            exp: 0,
            expToLevel: 100,
            hp: 100,
            maxHp: 100,
            creatures: [],
            location: 'Town'
        };

        let creatures = [
            {name: 'Steam Golem', hp: 50, attack: 10},
            {name: 'Clockwork Bird', hp: 30, attack: 15},
            {name: 'Gear Hound', hp: 40, attack: 12}
        ];

        let enemies = [
            {name: 'Rusty Automaton', hp: 30, attack: 5, exp: 20},
            {name: 'Oil Slime', hp: 20, attack: 7, exp: 15},
            {name: 'Bandit Mechanic', hp: 50, attack: 10, exp: 30}
        ];

        let locations = ['Town', 'Forest', 'Abandoned Factory'];

        let output = document.getElementById('output');
        let input = document.getElementById('input');

        function log(text) {
            output.innerHTML += text + '<br>';
            output.scrollTop = output.scrollHeight;
        }

        function startGame() {
            log('Welcome to the Steampunk Adventure!');
            showOptions();
        }

        function showOptions() {
            input.innerHTML = '';
            let exploreBtn = document.createElement('button');
            exploreBtn.textContent = 'Explore';
            exploreBtn.onclick = explore;
            input.appendChild(exploreBtn);

            let statusBtn = document.createElement('button');
            statusBtn.textContent = 'Status';
            statusBtn.onclick = showStatus;
            input.appendChild(statusBtn);

            let creaturesBtn = document.createElement('button');
            creaturesBtn.textContent = 'Creatures';
            creaturesBtn.onclick = showCreatures;
            input.appendChild(creaturesBtn);
        }

        function explore() {
            log('You venture into the ' + player.location + '...');
            let encounter = Math.random();
            if (encounter < 0.5) {
                battle();
            } else {
                findCreature();
            }
        }

        function battle() {
            let enemy = enemies[Math.floor(Math.random() * enemies.length)];
            log('An enemy ' + enemy.name + ' appears!');
            fightEnemy(enemy);
        }

        function fightEnemy(enemy) {
            input.innerHTML = '';
            let attackBtn = document.createElement('button');
            attackBtn.textContent = 'Attack';
            attackBtn.onclick = function() {
                let damage = Math.floor(Math.random() * 10) + 5;
                enemy.hp -= damage;
                log('You dealt ' + damage + ' damage to ' + enemy.name + '.');

                if (enemy.hp <= 0) {
                    log('You defeated ' + enemy.name + '!');
                    gainExp(enemy.exp);
                    showOptions();
                } else {
                    enemyAttack(enemy);
                }
            };
            input.appendChild(attackBtn);

            if (player.creatures.length > 0) {
                let creatureBtn = document.createElement('button');
                creatureBtn.textContent = 'Use Creature';
                creatureBtn.onclick = function() {
                    useCreature(enemy);
                };
                input.appendChild(creatureBtn);
            }
        }

        function enemyAttack(enemy) {
            let damage = Math.floor(Math.random() * enemy.attack);
            player.hp -= damage;
            log(enemy.name + ' dealt ' + damage + ' damage to you.');

            if (player.hp <= 0) {
                log('You have been defeated...');
                gameOver();
            } else {
                fightEnemy(enemy);
            }
        }

        function useCreature(enemy) {
            let creature = player.creatures[Math.floor(Math.random() * player.creatures.length)];
            let damage = Math.floor(Math.random() * creature.attack) + 5;
            enemy.hp -= damage;
            log('Your ' + creature.name + ' dealt ' + damage + ' damage to ' + enemy.name + '.');

            if (enemy.hp <= 0) {
                log('You defeated ' + enemy.name + '!');
                gainExp(enemy.exp);
                showOptions();
            } else {
                enemyAttack(enemy);
            }
        }

        function findCreature() {
            let creature = creatures[Math.floor(Math.random() * creatures.length)];
            log('You found a ' + creature.name + '!');

            let captureBtn = document.createElement('button');
            captureBtn.textContent = 'Capture';
            captureBtn.onclick = function() {
                player.creatures.push(creature);
                log('You captured the ' + creature.name + '!');
                showOptions();
            };
            input.innerHTML = '';
            input.appendChild(captureBtn);

            let leaveBtn = document.createElement('button');
            leaveBtn.textContent = 'Leave';
            leaveBtn.onclick = function() {
                log('You decided to leave the ' + creature.name + ' alone.');
                showOptions();
            };
            input.appendChild(leaveBtn);
        }

        function gainExp(exp) {
            player.exp += exp;
            log('You gained ' + exp + ' EXP.');

            if (player.exp >= player.expToLevel) {
                levelUp();
            }
        }

        function levelUp() {
            player.level++;
            player.exp = player.exp - player.expToLevel;
            player.expToLevel += 50;
            player.maxHp += 20;
            player.hp = player.maxHp;
            log('You leveled up! You are now Level ' + player.level + '.');
        }

        function showStatus() {
            log('--- Status ---');
            log('Level: ' + player.level);
            log('HP: ' + player.hp + '/' + player.maxHp);
            log('EXP: ' + player.exp + '/' + player.expToLevel);
            showOptions();
        }

        function showCreatures() {
            if (player.creatures.length > 0) {
                log('--- Your Creatures ---');
                player.creatures.forEach(function(creature, index) {
                    log((index + 1) + '. ' + creature.name + ' (HP: ' + creature.hp + ', Attack: ' + creature.attack + ')');
                });
            } else {
                log('You have not collected any creatures yet.');
            }
            showOptions();
        }

        function gameOver() {
            input.innerHTML = '';
            log('Game Over. You can restart the game.');
            let restartBtn = document.createElement('button');
            restartBtn.textContent = 'Restart';
            restartBtn.onclick = function() {
                location.reload();
            };
            input.appendChild(restartBtn);
        }

        startGame();
    </script>
</body>
</html>

Thursday, December 28, 2023

check

def simulate_scenario(starting_bet):
    bankroll = 100
    winning_multiplier = 6.6
    win_chance = 0.15 # 15%
    consecutive_losses_reset = 2

    # Variables to keep track of win streaks
    current_win_streak = 0
    longest_win_streak = 0
    ending_bankroll = 0

    # Simulate 10000 bets
    consecutive_losses = 0
    for _ in range(10000):
        # Place the bet
        if random.random() < win_chance: # Win
            bankroll += starting_bet * winning_multiplier
            starting_bet *= 2 # Increase the bet by 100% after a win
            consecutive_losses = 0 # Reset consecutive losses counter
            current_win_streak += 1
            if current_win_streak > longest_win_streak:
                longest_win_streak = current_win_streak
        else: # Loss
            bankroll -= starting_bet
            consecutive_losses += 1
            current_win_streak = 0 # Reset current win streak counter
            if consecutive_losses == consecutive_losses_reset:
                starting_bet = starting_bet - 0.002 if starting_bet > 0.002 else 0.001 # Decrease bet by 0.002 or set to minimum 0.001
                consecutive_losses = 0

    ending_bankroll = bankroll
    return ending_bankroll, longest_win_streak

Saturday, December 16, 2023

wager simulation

import random


# Define parameters

starting_wager = 0.03

multiplier = 7.0714

win_chance = 0.14

win_increase = 0.8

consecutive_losses_reset = 2

num_simulations = 1000

num_games_per_simulation = 1000


# Desired win streak lengths to track

desired_win_streaks = [2, 3, 4, 5]


# Function to simulate a single game

def simulate_game():

  current_wager = starting_wager

  consecutive_losses = 0

  consecutive_wins = 0

  win_streak_counts = {streak: 0 for streak in desired_win_streaks} # Initialize streak counters

  for _ in range(num_games_per_simulation):

    win = random.random() < win_chance

    if win:

      consecutive_wins += 1

      consecutive_losses = 0

      for streak in desired_win_streaks: # Update counters for desired streaks

        if consecutive_wins >= streak:

          win_streak_counts[streak] += 1

    else:

      consecutive_wins = 0

      consecutive_losses += 1

      if consecutive_losses == consecutive_losses_reset:

        current_wager = starting_wager

        consecutive_losses = 0

  return current_wager, win_streak_counts


# Run simulations and collect results

total_win_streaks = {streak: 0 for streak in desired_win_streaks}

for _ in range(num_simulations):

  _, win_streak_counts = simulate_game()

  for streak, count in win_streak_counts.items():

    total_win_streaks[streak] += count


# Analyze and print results

average_win_streak = sum(total_win_streaks.values()) / num_simulations

print(f"Average win streak needed: {average_win_streak:.2f}")


# Calculate and print success rates for different win streak lengths

success_rates = {}

for i in range(1, max(desired_win_streaks) + 1):

  success_rates[i] = sum(w >= i for w in total_win_streaks.values()) / len(total_win_streaks)

print("--- Success Rates by Win Streak Length ---")

for streak, rate in success_rates.items():

  print(f"{streak} wins: {rate:.2%}")


# Print specific win streak occurrences

print("--- Consecutive Win Occurrences ---")

for streak, count in total_w

in_streaks.items():

  print(f"{streak} wins: {count}")


Wager simulation

import random

# Define parameters
starting_bet = 0.03
multiplier = 6.6
win_chance = 0.15 # 15%
win_increase = 1.0 # 100% increase per win
target_amount = 10.0

# Function to simulate a single game
def simulate_game():
    bet = starting_bet
    consecutive_wins = 0
    while bet < target_amount:
        win = random.random() < win_chance
        if win:
            consecutive_wins += 1
            bet *= multiplier * win_increase
        else:
            consecutive_wins = 0
            bet = starting_bet
    return consecutive_wins

# Run simulations and collect results
num_simulations = 1000 # Increase for more accurate results
win_streaks = []
for _ in range(num_simulations):
    win_streaks.append(simulate_game())

# Analyze and print results
average_win_streak = sum(win_streaks) / len(win_streaks)
print(f"Average win streak needed: {average_win_streak:.2f}")

# Calculate and print success rates for different win streak lengths
success_rates = {}
for i in range(1, max(win_streaks) + 1):
    success_rates[i] = sum(w >= i for w in win_streaks) / len(win_streaks)
print("--- Success Rates by Win Streak Length ---")
for streak, rate in success_rates.items():
    print(f"{streak} wins: {rate:.2%}")


Sunday, January 17, 2021

Clarity

Tsst codes

ECONOMICS    MICROECONOMICS Monetize By  AKHILESH GANTI  Updated Aug 23, 2019 What Does Monetize Mean? "Monetize" refer...