gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
show micro code blocks of all proglngs examples. each example should be standardized and…
- User
show micro code blocks of all proglngs examples.
each example should be standardized and not less than 32 tokens in length examples in this chat.
- Assistant
Certainly! Below are micro code blocks for several popular programming languages. Each example is standardized and contains at least 32 tokens (including keywords, identifiers, operators, punctuation, and literals). The examples demonstrate a simple task: printing "Hello, World!" and a basic loop.
Python
# Print greeting print("Hello, World!") # Loop from 1 to 5 and print each number for i in range(1, 6): print(f"Number: {i}")
JavaScript
// Print greeting console.log("Hello, World!"); // Loop from 1 to 5 and print each number for (let i = 1; i <= 5; i++) { console.log("Number: " + i); }
Java
public class Main { public static void main(String[] args) { // Print greeting System.out.println("Hello, World!"); // Loop from 1 to 5 and print each number for (int i = 1; i <= 5; i++) { System.out.println("Number: " + i); } } }
C
#include <stdio.h> int main() { // Print greeting printf("Hello, World!\n"); // Loop from 1 to 5 and print each number for (int i = 1; i <= 5; i++) { printf("Number: %d\n", i); } return 0; }
Ruby
# Print greeting puts "Hello, World!" # Loop from 1 to 5 and print each number (1..5).each do |i| puts "Number: #{i}" end
Go
package main import "fmt" func main() { // Print greeting fmt.Println("Hello, World!") // Loop from 1 to 5 and print each number for i := 1; i <= 5; i++ { fmt.Println("Number:", i) } }
If you want examples in other languages or more complex examples, just let me know!
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.