codeblockstyling

codeblockstyling

For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file.

Group1

For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file.

Text Block Without Code

For Soroban projects, you'll also need to update soroban-sdk to 20.0.0-rc2 in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to 20.0.0-rc2 in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to 20.0.0-rc2 in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to 20.0.0-rc2 in your project's cargo.toml file.

inline test

// example code block
const multiLine = [];



For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file. For Soroban projects, you'll also need to update soroban-sdk to "20.0.0-rc2" in your project's cargo.toml file.

javascript

// Generates the first 'n' numbers in the Fibonacci sequence
function getFibonacciSequence(n) {
  const sequence = [0, 1]; // Start with the first two Fibonacci numbers

  // Loop to calculate the next numbers in the sequence
  for (let i = 2; i < n; i++) {
    const nextNumber = sequence[i - 1] + sequence[i - 2];
    sequence.push(nextNumber); // Add the next number to the sequence
  }

  return sequence; // Return the complete sequence as an array
}

const count = 10; // Define how many Fibonacci numbers to generate
const fibonacciNumbers = getFibonacciSequence(count);

// Output the result to the console
console.log(`First ${count} Fibonacci numbers:`, fibonacciNumbers);

java

// Generates the first 'n' numbers in the Fibonacci sequence
import java.util.ArrayList;
import java.util.List;

public class FibonacciExample {

    public static List<Integer> getFibonacciSequence(int n) {
        List<Integer> sequence = new ArrayList<>();
        sequence.add(0); // First Fibonacci number
        sequence.add(1); // Second Fibonacci number

        // Loop to calculate the next numbers in the sequence
        for (int i = 2; i < n; i++) {
            int nextNumber = sequence.get(i - 1) + sequence.get(i - 2);
            sequence.add(nextNumber); // Add the next number to the sequence
        }

        return sequence; // Return the complete sequence as a list
    }

    public static void main(String[] args) {
        int count = 10; // Define how many Fibonacci numbers to generate
        List<Integer> fibonacciNumbers = getFibonacciSequence(count);

        // Output the result to the console
        System.out.println("First " + count + " Fibonacci numbers: " + fibonacciNumbers);
    }
}

rust

// Generates the first 'n' numbers in the Fibonacci sequence
fn get_fibonacci_sequence(n: usize) -> Vec<u32> {
    let mut sequence = vec![0, 1]; // Start with the first two Fibonacci numbers

    // Loop to calculate the next numbers in the sequence
    for i in 2..n {
        let next_number = sequence[i - 1] + sequence[i - 2];
        sequence.push(next_number); // Add the next number to the sequence
    }

    sequence // Return the complete sequence as a vector
}

fn main() {
    let count = 10; // Define how many Fibonacci numbers to generate
    let fibonacci_numbers = get_fibonacci_sequence(count);

    // Output the result to the console
    println!("First {} Fibonacci numbers: {:?}", count, fibonacci_numbers);
}

Comments

// Single line comment
/// Doc comments
/* Multiline
comment */

Strings

'C'; '\''; '\n'; '\u{7FFF}'; // Characters
"foo \"bar\" baz"; // String
r##"foo #"bar"# baz"##; // Raw string with # pairs
b'C'; b'\''; b'\n'; // Bytes
b"foo \"bar\" baz"; // Byte string
br##"foo #"bar"# baz"##; // Raw byte string with # pairs

Numbers

0xff_u8;                           // type u8
0o70_i16;                          // type i16
0b1111_1111_1001_0000_i32;         // type i32

123.0f64;        // type f64
0.1f64;          // type f64
0.1f32;          // type f32
12E+99_f64;      // type f64

Booleans

true; false;

Functions and macros

println!("x is {}", x);
fn next_two(x: i32) -> (i32, i32) { (x + 1, x + 2) }
next_two(5);
vec![1, 2, 3];

Attributes

#![warn(unstable)]
#[test]
fn a_test() {
	// ...
}

Closure parameters and bitwise OR

let x = a | b;
let y = c || d;
let add_one = |x: i32| -> i32 { 1i + x };
let printer = || { println!("x is: {}", x); };

C#

// Generates the first 'n' numbers in the Fibonacci sequence
using System;
using System.Collections.Generic;

class FibonacciExample
{
    public static List<int> GetFibonacciSequence(int n)
    {
        var sequence = new List<int> { 0, 1 }; // Start with the first two Fibonacci numbers

        // Loop to calculate the next numbers in the sequence
        for (int i = 2; i < n; i++)
        {
            int nextNumber = sequence[i - 1] + sequence[i - 2];
            sequence.Add(nextNumber); // Add the next number to the sequence
        }

        return sequence; // Return the complete sequence as a list
    }

    static void Main()
    {
        int count = 10; // Define how many Fibonacci numbers to generate
        var fibonacciNumbers = GetFibonacciSequence(count);

        // Output the result to the console
        Console.WriteLine($"First {count} Fibonacci numbers: {string.Join(", ", fibonacciNumbers)}");
    }
}

JSON

{
  "user": {
    "id": 12345,
    "name": "Jane Doe",
    "email": "jane.doe@example.com",
    "roles": ["admin", "editor"],
    "isActive": true,
    "profile": {
      "age": 30,
      "location": "New York",
      "bio": "Loves coding and coffee."
    }
  },
  "settings": {
    "theme": "dark",
    "notifications": true,
    "language": "en-US"
  },
  "lastLogin": "2025-03-04T12:34:56Z"
}

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Example Page</title>
</head>
<body>
  <header>
    <h1>Welcome to My Website</h1>
  </header>
  <main>
    <p>This is an example paragraph with some <strong>bold text</strong>.</p>
    <button>Click Me</button>
  </main>
  <footer>
    <p>&copy; 2025 My Website</p>
  </footer>
</body>
</html>