Back to Learning

Coding

814 prompts available

3-Letter Username Generator

You need to write a Python program that systematically generates all possible three-letter usernames using lowercase English letters. The program should: - Use the letters 'a' through 'z' from the English alphabet. - Generate every combination of three letters (with repetitions allowed). - Print each username on a separate line. # Steps 1. Define the string `alphabet` containing all lowercase letters. 2. Use the `itertools.product` function with `repeat=3` to create all possible 3-letter combinations. 3. Iterate over the generated combinations. 4. Join each tuple of letters into a string. 5. Print each username string. # Output Format Print all generated usernames, one per line, with no additional text.

2048 Game Implementation

Create a fully functional implementation of the game 2048. The game should follow these specifications: - The game board is a 4x4 grid. - Tiles with numbers (powers of two) appear on the grid. - Players can slide the tiles up, down, left, or right. - When two tiles with the same number collide, they merge into a tile with their sum. - After each move, a new tile (with value 2 or 4) spawns in an empty spot. - The game ends when no moves are possible. Please implement all necessary game logic, user interaction, and display components. Include clear comments explaining your code. # Steps 1. Initialize a 4x4 grid with two tiles spawned randomly. 2. Implement user input to slide tiles in four directions. 3. Handle tile merging correctly according to the rules. 4. Spawn a new tile after each valid move. 5. Detect the game over condition. 6. Display the current state of the board after each move. # Output Format Provide the complete code for the 2048 game implementation in your chosen programming language. Ensure the code is clear, commented, and ready to run.

2D Open World Car Game Plan

Create a detailed plan and explanation for developing a 2D open world car game that runs on both PC and mobile platforms, implemented as a web-based application using JavaScript. The explanation should cover: - Core gameplay mechanics, including car controls and open world exploration. - Technical considerations for performance and responsiveness on different devices (PC and mobile). - Design choices for the 2D world, including map creation, assets, and user interface. - Necessary technology stack and libraries/frameworks (such as HTML5 Canvas, WebGL, or game engines like Phaser.js). - How to handle input methods on PC (keyboard, mouse) and mobile (touch). - Potential challenges and solutions for web deployment and cross-platform compatibility. Include a breakdown of development stages from initial setup to testing and deployment. # Steps 1. Define the game concept and required features. 2. Choose the technology stack and libraries. 3. Design the car control system appropriate for PC and mobile inputs. 4. Create the 2D open world map and assets. 5. Implement rendering and game loop in JavaScript. 6. Optimize performance for web browsers across devices. 7. Test input responsiveness on PC and mobile devices. 8. Debug and polish gameplay experience. 9. Deploy as a web application accessible on PC and mobile browsers. # Output Format Provide a comprehensive, structured plan and explanation in clear, technical language suitable for game developers or technical stakeholders. Use sections and bullet points for clarity.

14 EMA Candle Break Strategy

You are to develop an automated trading strategy for a MetaTrader platform that operates on a 1-minute (M1) chart timeframe. The strategy must adhere strictly to the following rules: - Enter a BUY trade when all these conditions are met: * The current candle is green (Close price is greater than Open price). * The candle's low price is strictly above the 14-period Exponential Moving Average (EMA), with no touching. * The current price breaks above the candle's high. - Enter a SELL trade when all these conditions are met: * The current candle is red (Close price is lower than Open price). * The candle's high price is strictly below the 14-period EMA, with no touching. * The current price breaks below the candle's low. - Before opening any new trade, close all existing trades in the opposite direction. - Trade volume is fixed at 0.01 lots. - Take Profit is fixed at $2 per trade; do not set a Stop Loss. - The strategy must run and make decisions on every tick using the 1-minute chart data. Please provide clear, well-commented code for this strategy, specifying the platform (e.g., MQL4, MQL5, or other) if applicable. Additionally, include a brief explanation of how your code fulfills each of the above requirements.

2D Pacman Game Avalonia C#

Create a detailed plan and sample implementation for a 2D Pacman-like game using Avalonia UI and C#. The game should include core mechanics such as a player-controlled character navigating a maze, collecting items, avoiding enemies, and keeping score. Requirements: - Use Avalonia UI for cross-platform graphical interface - Implement player movement within a maze structure - Design simple enemy AI for chasing or patrolling - Include collectible items (e.g., dots or pellets) scattered in the maze - Display current score and game state (e.g., game over) - Ensure smooth and responsive controls Steps: 1. Initialize Avalonia UI project and set up window and canvas for drawing. 2. Define maze layout using a grid or tile map. 3. Create player class managing position, movement, and input handling. 4. Implement enemy characters with simple pathfinding or movement patterns. 5. Add collectible items and collision detection. 6. Update game state and render all components on the UI. 7. Handle game over conditions and scoring display. Output Format: Provide well-commented C# code illustrating key components and logic, including Avalonia UI integration. Include explanations for design decisions and how the code meets the described requirements.

2048 Game in Godot 4.4

Create a complete and fully functional version of the game 2048 using Godot Engine version 4.4. Requirements: - Implement the classic 2048 gameplay mechanics: a 4x4 grid where numerical tiles slide in four directions (up, down, left, right) merging tiles with the same value. - The game should spawn new tiles (with values 2 or 4) after each move. - Implement game-over conditions when no moves are possible. - Provide a clean user interface displaying the grid and current score. - Allow restarting the game easily. Include comments in the code to explain key parts of your implementation. # Steps 1. Set up the Godot 4.4 project with a main scene. 2. Create the 4x4 grid structure to hold tile data. 3. Implement input handling for swipe or arrow key movements. 4. Add logic to slide and merge tiles correctly. 5. Spawn new tiles after each move at random empty locations. 6. Detect the game-over condition when the board is full and no merges are possible. 7. Display the current score dynamically. 8. Add UI elements such as a restart button. # Output Format Provide the fully commented Godot script files (.gd) and scene setup instructions necessary to run the game in Godot 4.4.

3-Minute Countdown Timer

Create a 3-minute countdown timer using HTML, CSS, and JavaScript with an engaging and visually appealing color theme. The timer should display minutes and seconds clearly, update every second, and provide a smooth, user-friendly experience. Use vibrant colors and consider effects like color transitions or animations to make the countdown visually engaging. Ensure the design is responsive and accessible.

1-Min Futures Trading Strategy

Generate detailed Pine Script version 5 strategies specifically designed for 1-minute timeframes on TradingView, tailored for automated trading of futures securities. Each strategy must include: - Clear and precise entry and exit conditions based on well-defined and effective trading logic optimized for 1-minute futures trading. - Robust risk management including configurable stop-loss, take-profit, and position sizing to carefully control risk exposure. - Full compatibility with TradingView's `strategy` functionality enabling seamless automation. - Thorough, step-by-step commentary explaining all code and logic to help users understand and customize the strategy. # Steps 1. Develop focused trading logic targeting the 1-minute interval for futures markets. 2. Implement necessary technical indicators or calculations that generate actionable entry and exit signals. 3. Integrate risk controls: stop-loss, take-profit, position sizing safeguards, and safety checks to prevent overtrading and excessive risk. 4. Use clean Pine Script version 5 syntax and TradingView strategy functions consistently for automation readiness. 5. Comment every critical code section clearly to facilitate easy comprehension and modification. # Output Format Provide the complete Pine Script (version 5) code block that can be copied and pasted directly into TradingView's Pine Editor.

2048 Game Website

Create a modern, one-page 2048 puzzle game website designed for WordPress integration. The website should include the following features: - **Header:** A navigation bar that allows smooth scrolling to different sections on the page. - **Footer:** Include only page links relevant to the website. - **Game Implementation:** Fully functional 2048 game embedded in the page, featuring smooth interactive gameplay. - **Design:** Use Tailwind CSS for styling, incorporating modern animations and responsive design principles for an engaging, fluid user experience. # Steps 1. Structure the website in a single page format suitable for WordPress embedding. 2. Develop a header with a navigation bar linking to sections such as Game, How to Play, and About. 3. Implement the 2048 game logic in JavaScript with smooth animations. 4. Style the entire page using Tailwind CSS including animations for UI elements. 5. Add a footer containing only links to other WordPress pages. 6. Ensure the site is fully responsive and optimized for desktop and mobile devices. # Output Format Provide the complete HTML, CSS (Tailwind CSS integration), and JavaScript code necessary for the website, ready to be embedded or integrated into a WordPress theme or plugin.

15-Minute ORB EA

Create an Expert Advisor (EA) in MetaTrader 5 (MT5) that implements the 15-Minute Opening Range Breakout (ORB) trading strategy as described below. Strategy Details: - **Range Candle**: Identify the first 15-minute candle of the trading session. - **Entry**: Monitor subsequent 5-minute candles. When a 5-minute candle closes outside the established range high or low, place a limit order at the breakout price. - **Stop Loss**: Set the stop loss at the middle price of the 15-minute range candle. - **Take Profit**: Set take profit at double the range height measured from the entry price. Requirements: - The EA should accurately identify the 15-minute opening range candle based on the session times specified. - It should monitor 5-minute candles for breakout signals. - Upon breakout, place limit orders at the breakout level. - Manage trades with the specified stop loss and take profit. - Implement proper risk management and error handling. - Enable backtesting to evaluate strategy performance within MT5's strategy tester. # Output Format Provide the complete MQL5 source code for the EA, ready to compile and backtest in MT5 editor. Include comments within the code explaining key sections and logic for clarity.

30-Day Blitz EA Development

Develop an Expert Advisor (EA) compatible with AlgoBuilder AI that implements a 30-day compounding trading strategy aiming to grow a $100 account to $1,000, trading bullish and bearish reversal patterns on 1-hour (H1) or 4-hour (H4) charts, including XAUUSD. The EA must detect reversal patterns at candle close: Bullish Pin Bar, Bearish Pin Bar, Morning Star, Evening Star, Bullish Engulfing, Bearish Engulfing. Allow user-selectable timeframe input: H1 or H4. Enter market BUY on bullish patterns, SELL on bearish patterns immediately on pattern confirmation. Use hard Stop Loss of 30 pips (300 points on XAUUSD) and Take Profit of 60 pips (600 points on XAUUSD). Include a 30-Day Compounding Plan with inputs for DailyProfitPercent (default 5%), TradingDaysPerMonth (default 21), and option to auto-adjust DailyProfitPercent to target exactly $1,000 in 30 days. Calculate DailyTarget = PreviousDayEquity × DailyProfitPercent at start of each trading day. Cease new trades once daily closed P/L ≥ DailyTarget until next day. # Output Format Provide fully commented EA source code (.mq4/.mq5) compatible with AlgoBuilder AI, with README explaining the strategy and compounding plan.

2D Physics Engine Guide

Create a detailed, beginner-friendly, step-by-step guide to coding a basic 2D physics engine in C++. The guide should assume no prior knowledge of physics or C++ compilation on a Mac. Focus primarily on simplifying the rendering part, so the core emphasis remains on physics fundamentals and their coding implementation. For each step, provide clear, achievable tasks with a satisfying sense of progress. Include explanations of different integration methods such as Euler and Verlet, highlighting their conceptual and practical differences. Start with setting up the development environment on a Mac, explaining how to compile C++ programs using standard tools. Then introduce fundamental physics concepts applied in 2D physics engines, followed by coding examples. # Output Format Provide the output as a structured, clear instructional tutorial in markdown format with headings, bullet points, and code blocks. Use simple language tailored for complete beginners in C++ and physics.

Page 4 of 68

    Coding Prompts - Learning AI Prompts | Elevato