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
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.
(post is archived)