User:HiyaHiya/Codebox: Difference between revisions

From Our World of Text Wiki
Jump to navigation Jump to search
No edit summary
Line 68: Line 68:


== html ==
== html ==
<syntaxhighlight lang="html">
<syntaxhighlight lang="html" line="1">
<!DOCTYPE HTML>
<!DOCTYPE HTML>
<!--  
<!--  
Line 75: Line 75:
-->
-->
<a href="https://owot.me">owot.me</a>
<a href="https://owot.me">owot.me</a>
 
<!-- A elements are anchor elements and allow you to link things -->
<abbr title="Hypertext Markup Language">HTML</abbr>
<!-- abbr elements are abbreviation elements -->
<address>
Written by <a href="mailto:[email protected]">dawgdawgdawg</a>.<br>
Visit us at:<br>
dawgdawgdawg.com<br>
Dawg Street, Dawglandia<br>
Dawgopolis
</address>
<!-- address elements are useful for writing addresses, both digital and physical. -->
</syntaxhighlight>
</syntaxhighlight>
== assembly ==
== assembly ==

Revision as of 10:17, 1 October 2023

jThis is dawgdawgdawg's codebox. Experimenting with the really, really big selection of languages in the code block menu

ABAP

REPORT TEST.
WRITE 'Hello World'.
WRITE 'This is an example code in ABAP'.
* there are many keywords
* this is a COMMENT
* Keywords list:
* are, ABAP, an, abapOperator, abs, acos, ADD, ALIAS, ALIASES, AND, APPEND, APPENDING, AS etc...
* might add more soon
ADD 5 TO 7. " This is addition in ABAP, or atleast i think.

js

// this is javascript ^_^
// chatgpt really helped
function isPrime(number) {
  if (number <= 1) {
    return false;
  }
  for (let i = 2; i * i <= number; i++) {
    if (number % i === 0) {
      return false;
    }
  }
  return true;
}
const num = 17;
if (isPrime(num)) {
  console.log(num + " is a prime number.");
} else {
  console.log(num + " is not a prime number.");
}

js+cheetah

// Import the CheetahJS library
import cheetah from 'cheetahjs';

// Define the ViewModel
const viewModel = {
  firstName: 'John',
  lastName: 'Doe',
  fullName: function() {
    return this.firstName + " " + this.lastName;
  }
};

// Bind the ViewModel to the HTML
cheetah.bind(viewModel, document.getElementById('app'));

c

#include <stdio.h>
int main(){
printf("Hello, This is a program in C");
return 0;
}

html

<!DOCTYPE HTML>
<!-- 
list of things i found here

-->
<a href="https://owot.me">owot.me</a>
<!-- A elements are anchor elements and allow you to link things -->
<abbr title="Hypertext Markup Language">HTML</abbr>
<!-- abbr elements are abbreviation elements -->
<address>
Written by <a href="mailto:[email protected]">dawgdawgdawg</a>.<br>
Visit us at:<br>
dawgdawgdawg.com<br>
Dawg Street, Dawglandia<br>
Dawgopolis
</address>
<!-- address elements are useful for writing addresses, both digital and physical. -->

assembly

section .data
hello: db "Hello, World!",10 ; declare the hello world variable
strlength: equ $-hello ; declare the length of the hello world variable and stick it in a other variable
section .text
global _start
_start:
mov eax,4 
mov ebx,1 ; blah blah blah, you already know what this is
mov ecx,hello
mov edx,strlength ; this just puts the string in the console
int 80h
mov eax,1 ; the end of the program
mov ebx,0
int 80h