WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2024 Poal.co

1.1K

I did 5 in another thread, but that was NSFW. I decided to make a clean one with 7 programming languages.

If anyone is interested in programming and/or programming languages. This might be worth checking out. This is just to show for the most part.

A-Z = 1-26 - side note: either upper or lower case

plus sign or + = 27

hash sign or # = 28

Used this for numbers.

http://1.bp.blogspot.com/-0At4ra_Bro8/TlxKun4yfxI/AAAAAAAAAC8/qCfGAkrbBBI/s640/a1b2c3.jpg


This is to show variables in 7 programming languages though. edit - 8 programming languages (Fortran in comments).

This is C++, Java, PHP, Javascript, C, Python, and C# (edit - Fortran in the comments).


https://www.w3schools.com/cpp/cpp_variables.asp

https://www.onlinegdb.com/online_c++_compiler

C++

3 + 27 + 27 = 57

#include <iostream>
using namespace std;

int main() {
int x = 3;
int y = 27;
int z = 27;
int sum = x + y + z;
cout << sum;
return 0;
}

https://www.w3schools.com/java/java_variables.asp

https://www.jdoodle.com/online-java-compiler/

Java

10 + 1 + 22 + 1 = 34

public class MyClass {
public static void main(String[] args) {
int w = 10;
int x = 1;
int y = 22;
int z = 1;
System.out.println(w + x + y + z); 
}
}

https://www.w3schools.com/php/phptryit.asp?filename=tryphp_var

PHP

16 8 16 = 40

<!DOCTYPE html>
<html>
<body>

<?php
$x = 16;
$y = 8;
$z = 16;
echo $x + $y + $z;
?>

</body>
</html>

https://www.w3schools.com/js/js_variables.asp

Javascript

10 + 1 + 22 + 1 + 19 + 3 + 18 + 9 + 16 + 20 = 119

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var q = 10;
var r = 1;
var s = 22;
var t = 1;
var u = 19;
var v = 3;
var w = 18;
var x = 9;
var y = 16;
var z = 20; 
var total = q + r + s + t + u + v + w + x + y + z;
document.getElementById("demo").innerHTML =
"The total is: " + total;
</script>

</body>
</html>

C - since C is one letter and it's the last one. Going to add up the other 4 in this one.

https://www.tutorialspoint.com/compile_c_online.php

top four

57 + 34 + 40 + 119 = 250

x4 = 1000

   #include <stdio.h>

   // Variable declaration:
   extern int a, b, c, d;
   extern int e;
   extern int w;

   int main () {

   /* variable definition: */
   int a, b, c, d;
   int e;
   int w; 

   /* actual initialization */
   a = 57;
   b = 34;
   c = 40;
   d = 119;

   e = a + b + c + d;
   printf("value of e : %d \n", e);

   w = e * 4;
   printf("value of w : %d \n", w);

   }

https://www.onlinegdb.com/online_python_compiler

https://www.w3schools.com/python/python_variables.asp

Python

16 + 25 + 20 + 8 + 15 + 14 = 98

 u = 16
 v = 25
 w = 20
 x = 8
 y = 15
 z = 14
 print(u + v + w + x + y + z)

https://www.tutorialspoint.com/compile_csharp_online.php

https://www.tutorialspoint.com/csharp/csharp_variables.htm

C#

3 + 28 = 31

  using System;

  namespace VariableDefinition {

  class Program {

  static void Main(string[] args) {
     short a;
     int b ;
     double c;

     /* actual initialization */
     a = 3;
     b = 28;
     c = a + b;
     Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c);
     Console.ReadLine();
   }
   }
   }

This is just for fun and I wanted to show people in case they were interested in programming languages. Let me know if I got anything wrong.


Jesus Christ is Lord and Savior - My religious side and/or spiritual side.

I did 5 in another thread, but that was NSFW. I decided to make a clean one with 7 programming languages. If anyone is interested in programming and/or programming languages. This might be worth checking out. This is just to show for the most part. A-Z = 1-26 - side note: either upper or lower case plus sign or + = 27 hash sign or # = 28 Used this for numbers. http://1.bp.blogspot.com/-0At4ra_Bro8/TlxKun4yfxI/AAAAAAAAAC8/qCfGAkrbBBI/s640/a1b2c3.jpg --- This is to show variables in 7 programming languages though. edit - 8 programming languages (Fortran in comments). This is C++, Java, PHP, Javascript, C, Python, and C# (edit - Fortran in the comments). --- https://www.w3schools.com/cpp/cpp_variables.asp https://www.onlinegdb.com/online_c++_compiler C++ 3 + 27 + 27 = 57 #include <iostream> using namespace std; int main() { int x = 3; int y = 27; int z = 27; int sum = x + y + z; cout << sum; return 0; } --- https://www.w3schools.com/java/java_variables.asp https://www.jdoodle.com/online-java-compiler/ Java 10 + 1 + 22 + 1 = 34 public class MyClass { public static void main(String[] args) { int w = 10; int x = 1; int y = 22; int z = 1; System.out.println(w + x + y + z); } } --- https://www.w3schools.com/php/phptryit.asp?filename=tryphp_var PHP 16 8 16 = 40 <!DOCTYPE html> <html> <body> <?php $x = 16; $y = 8; $z = 16; echo $x + $y + $z; ?> </body> </html> --- https://www.w3schools.com/js/js_variables.asp Javascript 10 + 1 + 22 + 1 + 19 + 3 + 18 + 9 + 16 + 20 = 119 <!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var q = 10; var r = 1; var s = 22; var t = 1; var u = 19; var v = 3; var w = 18; var x = 9; var y = 16; var z = 20; var total = q + r + s + t + u + v + w + x + y + z; document.getElementById("demo").innerHTML = "The total is: " + total; </script> </body> </html> --- C - since C is one letter and it's the last one. Going to add up the other 4 in this one. https://www.tutorialspoint.com/compile_c_online.php top four 57 + 34 + 40 + 119 = 250 x4 = 1000 #include <stdio.h> // Variable declaration: extern int a, b, c, d; extern int e; extern int w; int main () { /* variable definition: */ int a, b, c, d; int e; int w; /* actual initialization */ a = 57; b = 34; c = 40; d = 119; e = a + b + c + d; printf("value of e : %d \n", e); w = e * 4; printf("value of w : %d \n", w); } --- https://www.onlinegdb.com/online_python_compiler https://www.w3schools.com/python/python_variables.asp Python 16 + 25 + 20 + 8 + 15 + 14 = 98 u = 16 v = 25 w = 20 x = 8 y = 15 z = 14 print(u + v + w + x + y + z) --- https://www.tutorialspoint.com/compile_csharp_online.php https://www.tutorialspoint.com/csharp/csharp_variables.htm C# 3 + 28 = 31 using System; namespace VariableDefinition { class Program { static void Main(string[] args) { short a; int b ; double c; /* actual initialization */ a = 3; b = 28; c = a + b; Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c); Console.ReadLine(); } } } --- This is just for fun and I wanted to show people in case they were interested in programming languages. Let me know if I got anything wrong. --- Jesus Christ is Lord and Savior - My religious side and/or spiritual side.

(post is archived)

[–] [deleted] 0 pt (edited )

Is that PHP arrays then? What programming language is that?

https://www.w3schools.com/php/php_arrays.asp

Looks you copied and pasted this out of some server file that doesn't care about that. Doesn't care about making it look nice for a human to be able to read. Just this way in the file on some server alone.


edit: I wrote this in a couple of minutes (code below).


    #include<iostream>
   using namespace std;
   void merge(int [], int [], int, int)

   int main()
   {
    int arr1[100], arr2[100], arr3[100], a1, a2, i, j, k;

    cout<<"\n How Many Elements You Want to Enter in First Array?: ";
    cin>>a1;

    cout<<"\n Enter Elements in a First Array : \n";
    for (i = 0; i < a1; i++)
    {
            cout<<" ";
            cin>>arr1[i];
    }
    cout<<"\n How Many Elements You Want to Enter in Second Array? : ";
    cin>>a2;

    cout<<"\n Enter Elements in a Second Array : \n";
    for (i = 0; i < a2; i++)
    {
            cout<<" ";
            cin>>arr2[i];
    }
    merge(arr1, arr2, a1, a2);
    cout<<"\n First Sorted Array : \n";
    for (i = 0; i < a1; i++)
    {
            cout<<" ";
            cout<<arr1[i];
    }
    cout<<"\n\n Second Sorted Array : \n";
    for (i = 0; i < a2; i++)
    {
            cout<<" ";
            cout<<arr2[i];
    }  
    i = 0;
    j = 0;
    while (i < a1 && j < a2)
    {
            if (arr1[i] < arr2[j])
            {
                    arr3[k] = arr1[i];
                    i++;
            }
            else
            {
                    arr3[k] = arr2[j];
                    j++;
            }
            k++;
    }
    if (i >= a1)
    {
            while (j < a2)
            {
                    arr3[k] = arr2[j];
                    j++;
                    k++;
            }
    }
    if (j >= a2)
    {
            while (i < a1)
            {
                    arr3[k] = arr1[i];
                    i++;
                    k++;
            }
    }
    cout<<"\n\n Sorted Array After Merging : \n";
    for (i = 0; i < a1 + a2; i++)
    {
            cout<<" ";
            cout<<arr3[i];
    }
    return 0;
    }
   void merge(int arr1[], int arr2[], int a1, int a2) //Function for merging the sorted array
   {
    for (int i=a2-1; i>=0; i--)
    {
            int j, last = arr1[a1-1];
            for (j=a1-1; j >= 0 && arr1[j] > arr2[i]; j--)
                    arr1[j+1] = arr1[j];
            if (j != a1-1)
            {
                    arr1[j+1] = arr2[i];
                    arr2[i] = last;
            }
    }
    }

Obviously I didn't write this (above), but I think all of the 8 programming languages I used so far have arrays (don't quote me on this I may be wrong on a couple at least). This is just for show or an example of arrays in another programming language (C++). This is (basically - one realm of arrays in C++) arrays in C++ and just have to get (modify and/or add to) the code to do any math and/or addition, multiplication, subtraction, and/or division within this.

Got it from here (below). Not sure who wrote this originally.

https://www.tutorialride.com/cpp-array-programs/merge-two-sorted-arrays-c-program.htm


decided to get a joke in.

Excuse the lateness; I was off being a drunken lout and then I fell asleep in the garden.

Language is perl, because I basically only write in perl and C, and C's already been done in this thread. I'm also licensed to perpetrate COBOL, but that's no longer the firehose of money that it once was.

The biggest reason it looks ugly (outside of one-lining the whole thing) is the regexps used for numerical validation, which are just re-written forms of what Scalar::Util uses. One could simply use Scalar::Util qw(looks_like_number); and then replace $x =~ m/^[+-]?\d+$/ || $x =~ m/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ with looks_like_number($x) but that's the beauty of the ol' Swiss Army Chainsaw: There Is More Than One Way To Do It.

Doesn't care about making it look nice for a human

Hey, now. What I committed there was perfectly nice! I could've done something like this: http://www.99-bottles-of-beer.net/language-perl-737.html

[–] [deleted] 0 pt (edited )

Thanks, it's perl then. It looks very close to PHP.


I got into website building and web design (mostly just write CSS now if not other light coding) roughly 11-12 years ago. Many times I've seen files on the server look like the image below.

https://cdn.ttgtmedia.com/digitalguide/images/Misc/custom_owa_10.jpg

CSS file - not easy to read for humans, but the server reads it just fine. It's just not designed to look pretty just for a server more or so to be able to read. Nothing to do with being nice and/or not being nice. It's just designed for a server and not for human eyes for the most part.


Bottles of beer website looks like some coder was bored and having a bit of fun with code. I think I've seen that one before myself. Someone shared it with me a long time ago.