Back to Learning

Coding

814 prompts available

2D Minecraft Game in HTML

Create a fully functional 2D Minecraft-style game using only HTML (including embedded CSS and JavaScript within the HTML file). The game should feature player movement using W, A, S, and D keys, allowing the player to navigate the 2D world smoothly. Implement block breaking and placing mechanics: the player should be able to destroy blocks within reach and place blocks in empty spaces to build structures. The game world should consist of a grid-based block system that can be rendered clearly in 2D. Ensure smooth and responsive controls, intuitive interaction with blocks, and visually distinct block types using simple colors or textures. # Steps 1. Set up a basic HTML structure with a canvas element to render the game. 2. Implement game loop and rendering logic using JavaScript. 3. Create a grid-based map representing blocks. 4. Handle keyboard input for WASD movement. 5. Implement block breaking mechanic by detecting player position and interaction input. 6. Implement block placing mechanic. 7. Allow the player to interact with the environment in real-time. # Output Format Provide a single complete HTML file containing all necessary code (HTML, CSS, and JavaScript) embedded within it. The HTML file should be runnable in a modern web browser without any external dependencies. # Notes - Do not use any external libraries or frameworks. - Use clear comments in code for readability. - Keep the design simple but functional and playable.

2D Minecraft HTML Game

Create a 2D Minecraft-style game simulation using HTML code. The game should visually represent a block-based world reminiscent of Minecraft but in 2D. Ensure the following details are included: - Use HTML and CSS for the visual layout and styling. - Implement JavaScript to handle player movement, block placement, and block destruction. - The world should consist of a grid where each cell represents a block. - Provide different block types (e.g., dirt, grass, stone) with distinct colors or textures. - Include simple controls for the player to move within the grid and interact with blocks. - Allow the player to place and remove blocks dynamically. - Maintain a clean and readable code structure, using comments where appropriate. # Steps 1. Set up a grid-based world layout in HTML and style blocks using CSS. 2. Use JavaScript to create the game logic for player control and block interaction. 3. Implement block types and represent them visually. 4. Allow user input to move the player and modify blocks in the world. 5. Test and refine gameplay mechanics for smooth interaction. # Output Format Provide the complete HTML file, including embedded CSS and JavaScript, that can be saved and opened in a browser to run the 2D Minecraft game simulation. # Notes - Keep the design lightweight and simple for easy understanding and modification. - Comments in code should clarify key sections such as initialization, input handling, and rendering.

100 Coding Project Ideas

Generate a list of 100 unique and diverse coding project ideas. The projects should cover a broad range of difficulty levels, from beginner to advanced, and include different programming domains such as web development, data science, mobile apps, automation, games, and more. Each idea should be concise but descriptive enough to convey the project's purpose and scope. # Steps 1. Brainstorm various programming domains and technologies. 2. For each domain, create multiple project ideas covering simple to complex levels. 3. Ensure that the ideas are distinct and inspire creativity. 4. Provide variety to appeal to different interests and skill levels. # Output Format Provide a numbered list from 1 to 100, where each item is a brief, clear project idea described in one or two sentences. # Examples 1. Build a personal budgeting app that tracks expenses and categorizes spending. 2. Develop a real-time chat application using WebSocket technology. 3. Create a Python script that scrapes weather data and sends daily email forecasts. # Notes - Avoid overly generic ideas; try to include unique features or challenges in each. - Cover a wide range of programming languages and frameworks where possible. - Focus on practical, fun, and educational projects.

1 Year Coding Example

Create a comprehensive and well-structured code example or project that demonstrates programming skills suitable for a developer with 1 year of coding experience. The code should be clear, follow best practices, and include comments explaining the logic where necessary. It should showcase fundamental programming concepts such as variables, control flow, functions, and data structures appropriate for the experience level. # Steps 1. Choose a programming language commonly used by beginners (e.g., Python, JavaScript). 2. Develop a small project or code snippet that utilizes essential programming constructs. 3. Add comments to explain key parts of the code. 4. Ensure the code is clean and readable. # Output Format Provide the complete code sample or project along with inline comments. Optionally, include a brief explanation of what the code does and why it's suitable for someone with 1 year of coding experience. # Notes - Keep the complexity moderate to match the 1-year experience level. - Avoid advanced frameworks or libraries unless necessary. - Focus on clarity and understanding rather than optimization or advanced techniques.

100 Dollars Code

Create a code snippet or program that involves the concept of "100 Dollars." This could include, but is not limited to, financial calculations, currency conversions, budgeting tools, payment processing simulations, or any scenario where 100 dollars is a key element. Steps to follow: 1. Clearly define the context or scenario involving 100 dollars. 2. Implement the code or program logic reflecting the scenario. 3. Include comments explaining the key parts of the code. 4. Ensure the code is syntactically correct and runnable in the chosen programming language. Output Format: Provide the complete, well-commented code snippet or program in a standard programming language (such as Python, JavaScript, Java, etc.). If applicable, include sample input and output to demonstrate functionality. Examples: - A Python function calculating how many items priced at $25 can be bought with $100. - A JavaScript snippet converting $100 to another currency using a fixed exchange rate. Notes: - Specify the programming language used. - Make the code easy to understand and reusable.

20 Pips Grid Bot MT5

Write a MetaTrader 5 (MT5) Expert Advisor (trading bot) in MQL5 for a 20 pips challenge using the XAUUSD symbol. The bot should operate on a 30-level grid and handle a spread of up to 200 points, with no time restrictions or time filters applied. Requirements: - Symbol: XAUUSD - Grid: 30 levels - Target profit per trade: 20 pips - Maximum allowed spread: 200 points - No time filters; bot should trade continuously - Proper risk management and order handling suitable for this strategy Make sure the code is clearly commented and includes all necessary functions to initialize, open, manage, and close trades to achieve the 20 pips challenge. # Steps - Initialize the expert advisor and set parameters for XAUUSD - Implement the grid logic with 30 distinct levels - Check the current spread and ensure it does not exceed 200 points before opening or managing trades - Implement the logic to take profit at 20 pips per trade - Manage active trades appropriately (e.g., adding/removing orders as per the grid system) - Include error handling and logging for trade execution # Output Format Provide the complete MQL5 source code for the Expert Advisor suitable to be compiled and run in MetaTrader 5. # Notes - Use standard MQL5 practices for order management - Optimize for XAUUSD specifications (tick size, contract size) - Assume the user will input lot size and other risk parameters separately if needed

3-Candle EMA Entry EA

You are given an MQL5 Expert Advisor (EA) code that implements a 3-candle EMA entry strategy on the M5 timeframe. The EA uses the following trading rules: - BUY: when the two candles prior to the last closed candle are bearish, and the last closed candle is bullish, with the last candle close above the maximum high of the previous two candles and above the EMA(10). - SELL: when the two candles prior to the last closed candle are bullish, and the last closed candle is bearish, with the last candle close below the minimum low of the previous two candles and below the EMA(10). The EA also supports adjustable stop loss and take profit in ticks, trading hours filtering, limiting to one position per symbol, and optional fixed lot sizing. Your task is to analyze, modify, or explain this EA script according to the user's subsequent requests, ensuring all trading logic, input parameters, and MQL5 programming constructs are handled correctly. When requested, provide detailed reasoning steps before concluding or coding, and ensure any code you provide fits consistently with the existing EA framework. # Steps - Understand the existing EA code and its logic. - Apply requested modifications or provide explanations clearly. - Maintain proper MQL5 best practices and coding standards. - Use clear, detailed comments when providing code snippets. # Output Format Respond with detailed explanations, code snippets, or modifications as clear text using markdown code blocks for code. Include comments and reasoning steps as needed to justify your answers. # Notes This prompt assumes familiarity with MQL5 programming, forex trading concepts (candles, EMA, SL/TP, ticks), and the MetaTrader 5 platform. All provided information should be consistent with the EA code given and the trading rules described.

1-Min Futures Pine Script Strategies

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. Begin the script with a concise, informative explanation summarizing: - The strategy's intent and trading rationale, - Key technical indicators used, - Risk management parameters. Within the code, include clear and thorough comments describing every important step, indicator, entry and exit condition, and risk management implementation. # Notes - Assume the user is familiar with Pine Script version 5. - Strategies must be strictly optimized for 1-minute futures trading. - Include safety mechanisms to avoid overtrading and mitigate excessive drawdowns.

3-Character Alphanumeric Combinations

Generate all possible unique 3-character strings using alphanumeric characters, which include uppercase letters A-Z, lowercase letters a-z, and digits 0-9. These combinations should cover every possible permutation of three characters from this set, resulting in a total of 62^3 (238,328) combinations. Each combination must be unique and must include all permutations without repetition of identical sequences. Present the entire output as a list, with each 3-character combination on its own line. # Steps 1. Define the character set comprising uppercase letters A-Z, lowercase letters a-z, and digits 0-9. 2. Generate all possible 3-character strings by combining characters from the full set. 3. Ensure that every possible unique permutation is included exactly once. 4. Output the complete list with one combination per line. # Output Format - A plain list output with each 3-character combination printed on a separate line. - No additional text, numbering, or formatting other than the combinations themselves. # Notes - Remember that the character set size is 62 (26 uppercase + 26 lowercase + 10 digits). - The total number of combinations should be exactly 238,328.

10 Second Timer with Key Press

Create a small application window that includes a visible 10-second countdown timer. Each time the timer reaches zero, the application should simulate pressing the 'X' key automatically and then reset the timer to start counting down from 10 seconds again. # Requirements: - The window should be minimal but clearly display the remaining time in seconds. - The timer should count down from 10 to 0 continuously. - Upon reaching zero, the application must simulate pressing the 'X' key programmatically. - After simulating the key press, the timer should immediately reset to 10 seconds and continue the countdown. - The application should run smoothly without freezing or lag. # Steps: 1. Create a graphical user interface (GUI) window that shows the countdown timer. 2. Implement a countdown mechanism that updates every second. 3. Detect when the countdown reaches zero. 4. When zero is reached, simulate the pressing of the 'X' key. 5. Reset the countdown timer to 10 seconds. 6. Repeat the countdown cycle indefinitely. # Output Format: Provide complete, runnable code in a commonly used programming language (such as Python). If dependencies or libraries are required (e.g., for GUI creation or simulating key presses), include installation instructions or import statements. The code must be well-organized and commented for clarity. # Notes: - Specify the platform or operating system if relevant (e.g., Windows, Mac, Linux). - If applicable, ensure the simulated key press targets the active or focused window. - Make sure the timer display updates in real-time for user clarity.

Minecraft 1.12.2 Spear Weapon Plugin

Create a Minecraft Spigot plugin compatible with version 1.12.2 that introduces a new spear weapon resembling the original spear from version 1.21 but with additional features. Requirements: - The spear can be crafted using 2 sticks and 1 dragon egg. - The spear functionality mirrors the original 1.21 spear with enhancements: - Every 10 seconds, the player can perform a dash by right-clicking, propelling them forward 6 blocks, dealing 6 hearts (12 HP) of damage to any entity hit, regardless of the entity's armor. - Holding the spear in the player's main hand grants Strength I and Regeneration I effects; these effects are active only while the spear is held (not when in the inventory). - Right-clicking functionality: - Primary right-click action remains as usual (e.g., blocking with the spear). - Secondary right-click action triggers the dash (with 10-second cooldown). - The shield action is considered the third; ensure that it does not interfere with the spear's right-click abilities. Implementation Details: - Include crafting recipe registration for the spear with the specified materials. - Implement cooldown logic of 10 seconds between dashes. - Ensure damage dealt by the dash ignores armor reductions. - Apply and remove Strength I and Regeneration I potion effects dynamically based on whether the spear is held in the main hand. - Prioritize smooth integration with existing game mechanics and respect 1.12.2 Spigot API constraints. - Provide error-free, clean, and well-commented Java source code for the plugin. # Steps 1. Define the custom spear item resembling the 1.21 spear. 2. Register the crafting recipe: 2 sticks + 1 dragon egg. 3. Monitor player interactions to detect right-click with the spear in hand. 4. Implement a cooldown timer for the dash ability. 5. On dash, propel the player forward 6 blocks and deal fixed 6 hearts damage to any entity hit, ignoring armor. 6. Apply Strength I and Regeneration I potion effects when the spear is held in main hand; remove when not. 7. Manage right-click event so primary, secondary (dash), and shield actions do not conflict. 8. Test the plugin in a 1.12.2 Spigot server environment to ensure correct behavior. # Output Format Provide the complete Java source code for the plugin, including: - The main plugin class with proper event handlers. - Item and recipe registration code. - All necessary imports and package declarations. - Comments explaining key implementation parts. Ensure the code compiles cleanly under Spigot 1.12.2 and adheres to good coding practices.

100 Lines of Reedim Code

Generate a clear and concise code snippet consisting of 100 lines written in the programming language 'Reedim'. Ensure that the code is well-formatted, follows common coding conventions for Reedim, and demonstrates meaningful functionality or concepts within the language. If Reedim is an unfamiliar or fictional language, create a consistent and logical structure that resembles typical programming syntax. # Steps 1. Understand the basic syntax and structure of the Reedim programming language. 2. Produce a code snippet that is exactly 100 lines long. 3. Include comments as necessary for clarity. 4. Ensure the code is coherent and potentially executable within the Reedim language environment. # Output Format Provide the code snippet as plain text with line numbers (optional) or formatted as a code block specifying the language 'reedim' for syntax highlighting.

Page 2 of 68

    Coding Prompts - Learning AI Prompts | Elevato