Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 **For those who have guessed correctly, here:**http://www.touchofdeathforums.com/smf/index.php?topic=42526.msg425142#msg425142Everyone who was in the Eclipse Chat room while we were talking about these languages(you know who you are), DO NOT POST; I want to see who can identify these (if you're an old-schooler, just PM me with what you think they are).Who can tell me what programming languages these are:**1: C++ (Fruitpunch found the answer)**```#include using namespace std;int main(){ int a[]={5,4,2,8,1,9,2,10,3,7,6}; int i,j,temp; for(i=0;i<11;i++) cout<a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } for(i=0;i<11;i++) cout<;foreach(sort mysort @words) { print;}sub mysort { $aa=$a;$bb=$b; ($aa =~ tr/eE/eE/) <=> ($bb=~ tr/eE/eE/) || lc($a) cmp lc($b);}[/code][b]3: [color]Plankalkül (Zananok found the answer, and without google!)[/color][/b][code]W1[0](4)[ V0[i0:8.0] => Z0[i0:8.0] 1 => Z4[:32.0] W1[1](i0) [ (V0[i0:8.0] < Z0[i1:8.0]) & (Z4[:32.0]=1) -> [ i0-i1 => Z1[:32.0] W1[2](Z1[:32.0]) [ i0 - i2 - 1 => Z3[:32.0] i0 - i2 => Z2[:32.0] Z0[Z3[:32.0]:8.0] => Z0[Z2[:32.0]:8.0] ] V0[i0:8.0] => Z0[i1:8.0] 0 => Z4[:32.0] ] ]]END[/code][b]4: [color]FORTRAN (Fruitpunch found the answer)[/color][/b][code] SUBROUTINE SSORT (X, IY, N, KFLAG) IMPLICIT NONE INTEGER KFLAG, N REAL X(1:N) INTEGER IY(N) REAL TEMP INTEGER I, ISWAP(1), ITEMP, ISWAP1 INTRINSIC MAXLOC DO 200 I=1,N-1 ISWAP=MAXLOC(X(I:N)) ISWAP1=ISWAP(1)+I-1 IF(ISWAP1.NE.I) THEN TEMP=X(I) X(I)=X(ISWAP1) X(ISWAP1)=TEMP ITEMP=IY(I) IY(I)=IY(ISWAP1) IY(ISWAP1)=ITEMP ENDIF 200 CONTINUE RETURN END[/code][b]5: [color]Forth (Skell found the answer; did he google?)[/color][/b][code]: sort depth 2 > if over over < if swap then rot over over < if swap then -> a recurse a else over over < if swap then then ;[/code][b]6: [color]COBOL (Tyr found the answer)[/color][/b][code] $ SET SOURCEFORMAT"FREE"IDENTIFICATION DIVISION.PROGRAM-ID. InputSort.AUTHOR. Michael Coughlan.ENVIRONMENT DIVISION.INPUT-OUTPUT SECTION.FILE-CONTROL. SELECT StudentFile ASSIGN TO "SORTSTUD.DAT" ORGANIZATION IS LINE SEQUENTIAL. SELECT WorkFile ASSIGN TO "WORK.TMP".DATA DIVISION.FILE SECTION.FD StudentFile.01 StudentDetails PIC X(30).SD WorkFile.01 WorkRec. 02 WStudentId PIC 9(7). 02 FILLER PIC X(23).PROCEDURE DIVISION.Begin. SORT WorkFile ON ASCENDING KEY WStudentId INPUT PROCEDURE IS GetStudentDetails GIVING StudentFile. STOP RUN.GetStudentDetails. DISPLAY "Enter student details using template below." DISPLAY "Enter no data to end.". DISPLAY "Enter - StudId, Surname, Initials, YOB, MOB, DOB, Course, Gender" DISPLAY "NNNNNNNSSSSSSSSIIYYYYMMDDCCCCG" ACCEPT WorkRec. PERFORM UNTIL WorkRec = SPACES RELEASE WorkRec ACCEPT WorkRec END-PERFORM.[/code][b]7: [color]Assembly (StingRay found the answer)[/color][/b][code] add $s3, $zero, $zerofors: slt $t2, $s3, $s2 beq $t2, $zero, endfors add $t0, $s3, $zero sll $t3, $s3, 2 add $a0, $s0, $t3 sll $t3, $t0, 2 add $a1, $s0, $t3 jal Swap addi $s3, $s3, 1 # s++ j forsendfors:addi $sp, $sp, -20 sw $ra, 16($sp) lw $ra, 16($sp)sw $s3, 12($sp) lw $s3, 12($sp)sw $s2, 8($sp) lw $s2, 8($sp)sw $s1, 4($sp) lw $s1, 4($sp)sw $s0, 0($sp) lw $s0, 0($sp) addi $sp, $sp, 20add $s0, $a0, $zeroadd $s1, $a1, $zero jr $raaddi $s2, $s1, -1[/code]The person who guesses the languages correctly, can put up examples of other ones for other ppl to guess :azn:NOTE: The logic may be off on some of these, but you just need the syntax to tell what language it is anywayEDIT: I have a feeling Godlord is going to come into this topic, and not only identify all of these, but then explain what's wrong in the syntax[/i][/i]``` Link to comment Share on other sites More sharing options...
Fruitpunch Posted April 13, 2009 Share Posted April 13, 2009 im guessing one of those is fortran but thats the only ancient computer language I have heard of Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 @Fruitpunch:> im guessing one of those is fortran but thats the only ancient computer language I have heard ofNot all of them here are acient; I'll modify one of the languages, it will make more sense (I forgot the header)EDIT: Also yes, one of them are FORTRAN; just got to guess which one XD Link to comment Share on other sites More sharing options...
Fruitpunch Posted April 13, 2009 Share Posted April 13, 2009 im gonna guess one is C. Two is VB. Four is Fortran I think, and Six might be Assembly? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 @Fruitpunch:> im gonna guess one is C. Two is VB. Four is Fortran I think, and Six might be Assembly?1 is sort of correct (C doesn't use the iostream.h library).2 isn't VB4 ~~is~~ is not FORTRAN6 is not asm Link to comment Share on other sites More sharing options...
Fruitpunch Posted April 13, 2009 Share Posted April 13, 2009 is one C++hah I guessed FORTRAN im good xD Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 Yes, you got it, 1 is C++#5 wasn't showing up correctly, but I fixed it xD Link to comment Share on other sites More sharing options...
Tyr Posted April 13, 2009 Share Posted April 13, 2009 6 is COBOL :] Link to comment Share on other sites More sharing options...
azkanan Posted April 13, 2009 Share Posted April 13, 2009 Aw. Was hoping this was spoken languages. =[…I'll have to do that some time. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 @Tyr:> 6 is COBOL :]Correct! Link to comment Share on other sites More sharing options...
Zananok Posted April 13, 2009 Share Posted April 13, 2009 I needed google for the 5th… Sadly, but I did heard the name before though... Just haven't seen it in action before.Comments,From: Zananok Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 @Zananok:> I needed google for the 5th… Sadly, but I did heard the name before though... Just haven't seen it in action before.> > Comments,> From: ZananokI see; either way, you got afew of them right (and getting Plankalkul right WITHOUT googling it, that's amazing!)EDIT: Only reason I didn't put the 5th one up yet, is because you googled it (and I want to see who else can take a swing at it; though I'm sure someone is bound to google it now anyways) Link to comment Share on other sites More sharing options...
Zananok Posted April 13, 2009 Share Posted April 13, 2009 @Ã…ÃÂüiÑÂôζ:> I see; either way, you got afew of them right (and getting Plankalkul right WITHOUT googling it, that's amazing!)> EDIT: Only reason I didn't put the 5th one up yet, is because you googled it (and I want to see who else can take a swing at it; though I'm sure someone is bound to google it now anyways)Don't worry, I dont mind ;)But like you said, hopefully someone can without google.Comments,From: Zananok Link to comment Share on other sites More sharing options...
StingRay200 Posted April 13, 2009 Share Posted April 13, 2009 I think 7\. is Assembly Code Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted April 13, 2009 Share Posted April 13, 2009 2 looks like RubyI agree with 7 being assembly5 looks obsolete. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 7 is assembly2 does look like Ruby, but I'm looking for another language (you're close though).Hey! 5 isn't obsolete :sad:Okay, I'll give you guys a hint…2 is an easy one (really, it is!)5 is a stack-oriented programming language. Link to comment Share on other sites More sharing options...
Akselj Posted April 13, 2009 Share Posted April 13, 2009 I guess 2 is Perl. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 @[SB:> AkselJ link=topic=42526.msg425077#msg425077 date=1239652261]> I guess 2 is Perl.Your guess is right (finally… Thought that was an easy one!).And nobody can figure out what 5 is?I think the hardest one was 3 Link to comment Share on other sites More sharing options...
Tyr Posted April 13, 2009 Share Posted April 13, 2009 1 more guys :)i don't know 5: but i say.. Python :p Link to comment Share on other sites More sharing options...
Skell Posted April 13, 2009 Share Posted April 13, 2009 I guess Forth, looks like it. Link to comment Share on other sites More sharing options...
Tyr Posted April 13, 2009 Share Posted April 13, 2009 @Skell:> I guess Forth, looks like it.its forth… google is your friend :] Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 @Skell:> I guess Forth, looks like it.You would guess right, which means either:* You googled* You were one of the hardcore programmers that tried to learn forth, but it pushed you over the edge* You managed to actually learn Forth Link to comment Share on other sites More sharing options...
Zananok Posted April 13, 2009 Share Posted April 13, 2009 Hmm, 2 is PERL, that's why i saw a similarity and thought was PHP.Comments,From: Zananok Link to comment Share on other sites More sharing options...
Skell Posted April 13, 2009 Share Posted April 13, 2009 @Ã…ÃÂüiÑÂôζ:> You would guess right, which means either:> > * You googled> * You were one of the hardcore programmers that tried to learn forth, but it pushed you over the edge> * You managed to actually learn ForthNone, I am one that know one who * were one of the hardcore programmers that tried to learn forth, but it pushed you over the edge Link to comment Share on other sites More sharing options...
Admiral Refuge Posted April 13, 2009 Author Share Posted April 13, 2009 Okay, now what? Now you tell me what each program does, if you're soooo smart XDDon't just tell me what it does, but HOW it does it XDC++ (this is for Fruitpunch; if ya can't figure it out, someone else is welcomed to, but you need to tell us you can't figure it out!)```#include using namespace std;const char K = ' ';int main(){char M8[4] = " TH";char M = 'L', D = 'R', Y[3] = "ME", H[4] = "OST", R[3] = "JU", A[3] = "ST";cout << 'U' << K;cout << R << A;cout << K << M << H << M8 << "E ";cout << 'G' << 'A' << Y;cout << endl;return 0;} ```Perl (Aksel, you BETTER be able to figure this one)**Aksel Figured this one out (email system)**```#!/usr/bin/perl -w use strict;use CGI; use Email::Valid; my $query = new CGI; unless (Email::Valid->address($query->param('send_to'))) { print $query->header; print "You supplied an invalid email address."; exit; } my $sendmail = "/usr/sbin/sendmail -t"; my $reply_to = "Reply-to: foo\@bar.org\n"; my $subject = "Subject: Confirmation of your submission\n"; my $content = "Thanks for your submission."; my $to = $query->param('send_to')."\n"; my $file = "subscribers.txt"; unless ($to) { print $query->header; print "Please fill in your email and try again"; } open (FILE, ">>$file") or die "Cannot open $file: $!"; print $to,"\n"; close(FILE); my $send_to = "To: ".$query->param('send_to'); open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!"; print SENDMAIL $reply_to; print SENDMAIL $subject; print SENDMAIL $send_to; print SENDMAIL "Content-type: text/plain\n\n"; print SENDMAIL $content; close(SENDMAIL); print $query->header; print "Confirmation of your submission will be emailed to you.";```Plankalkül - this is open to anyone who can figure it out without google (explain to me HOW it works, not what it does)```P5 R(V0[:32.0]) => R0[:32.0]1 => Z0[:32.0]W1 (5)[ i * Z0[:32.0] => Z0[:32.0]]Z0[:32.0] => R0[:32.0]END```FORTRAN - Pretty streightforward (my syntax may be off, but you can still see what it's doing)``` PROGRAM MAIN COMMON /GLOBALS/ M INTEGER N EXTERNAL SUB1 PRINT *, 'Enter value' READ (*,*) N CALL SUB1(N) END SUBROUTINE SUB1(N) M=N*N PRINT *, M RETURN END```Forth (You want a try at it Skell? Who wants one?)``` hex 4666 dup negate do i 4000 dup 2* negate do " *" 0 dup 2dup 1e 0 do 2swap * e >>a 2* 5 pick + -rot - j + dup dup * e >>a rot dup dup * e >>a rot swap 2dup + 10000 > if 3drop 3drop " " 0 dup 2dup leave then loop 2drop 2drop type 268 +loop cr drop 5de +loop ;```Na, I'm kidding… The above though, would generate the MandelbrotSet, but I couldn't get it to work.. So, someone figure this out:```: fac 1 swap 1 max 1+ 2 ?do i * loop ;```And then, someone puts in the Forth Terminal:5 facI'll leave COBOL and ASM out ;) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now