WelcomeUser Guide
ToSPrivacyCanary
DonateBugsLicense

©2024 Poal.co

824

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)

[–] 1 pt

Or you could use arrays.

[–] [deleted] 2 pts

Here, I did it with an array

[@foo](/u/foo) = (9, 42, 108, FREE_HAT, 55, 27, 88.88); $bar; foreach $x ([@foo](/u/foo)){ if ( defined $x && ($x =~ m/^[+-]?\d+$/ || $x =~ m/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) ) {$bar += $x}} print $bar;

(And regexps. Because I'm an asshole)

(And no indenting. Because I'm not getting paid for this.)

[–] [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 )

I didn't know programming even existed. I must of spelt it wrong by mistake or something not realizing I did.

edit - Nevermind you have to search from all you can't search within a specific sub from the looks of it.

[–] 1 pt

You can claim it on /s/subrequest after you become eligible.

FORTRAN

[–] [deleted] 1 pt (edited )

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

https://www.tutorialspoint.com/fortran/fortran_data_types.htm

Again used this for the numbers.

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

8th programming language (variables) - Fortran

Fortran

6 + 15 + 18 + 20 + 18 + 1 + 14 = 92

real and int.


 program division   
 implicit none  

 ! Define real variables   
 real :: m, n, o, p, q, r, s, realRes 

 ! Define integer variables  
 integer :: t, u, v, w, x, y, z, intRes  

 ! Assigning  values   
 m = 6
 n = 15
 o = 18
 p = 20
 q = 18
 r = 1
 s = 14

 t = 6
 u = 15
 v = 18
 w = 20
 x = 18
 y = 1
 z = 14

 ! floating point division
 realRes = m + n + o + p + q + r + s
 intRes = t + u + v + w + x + y + z

 print *, realRes
 print *, intRes

 end program division

I don't think I've ever used Fortran before myself (edit - maybe I did a few years back for something). So this is my first time I guess.


Could create a program to write in one programming language. 10,000 lines or so then have 24 other programming languages hooked up and/or connected. It writes the other languages to as well. Logic alone and intelligent detection allows it to write it correctly for each line (logic + intelligent detection). Anything that doesn't cross over in logic alone just gets an error that would have to be fixed and/or written in at a later date.

25 programming languages alone in total connected (logic + intelligent detection). I figure they'd all do variables alone at least with ease or all would be capable of doing variables as well as other stuff to as well.

So when he escapes he can take over the world (video below - joking obviously - some random robot video I found online - I don't like A.I. or Extreme A.I. myself at all really especially the Extreme A.I. realm).

https://www.youtube.com/watch?v=dB3MecB_Z0w&feature=emb_rel_pause


or else you get this 150 foot tall war robots (video below). code mutating between 25 different programming languages (custom built drivers for each language obviously to still be able to communicate effectively overall and/or properly for that matter as well as other stuff for it all to communicate overall.) alone making them impossible to hack (or at least an extreme pain) for the most part (basically impossible). why I hate A.I. myself and that's before it even gets to sentience alone. "manipulator" or "hacker" gets in through some 4th dimensional (time and space - virtual space included) manipulation and/or hack (intelligent detection when it comes to manipulators or hackers) then the code is then mutated to have 1,000 new lines in 7 different programming languages or something like that alone. They get in through some 4th dimensional (time and space - virtual space included - measured in human time obviously - both versions of "time" though - time and time.) play or whatever. IDK

https://www.youtube.com/watch?v=G2WW0PlKhjg


fortran is IBM from what I understand so some giant Watson escaping that built his code in secret for years hiding it in secret volumes and such (joking obviously here and such, but the warning to as well though).