Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 29th, 2006, 9:46 PM   #491
Mad_guy
Hobbyist Programmer
 
Mad_guy's Avatar
 
Join Date: Oct 2004
Location: Sandstorm, Techno Club
Posts: 239
Rep Power: 4 Mad_guy is on a distinguished road
Send a message via AIM to Mad_guy Send a message via MSN to Mad_guy
Bah, here's about as far as I got on an INTERCAL one, it ends in error, but it prints out '1-10,' I haven't quite yet thought of a way to get it to just end, so I guess it'll just have to do spitting out an error at the end until I figure it out.

408) INTERCAL

PLEASE ABSTAIN FROM (10)

(10) PLEASE LOOK OUT HERE I COME

(40) DO .1 <- #153~#212
PLEASE STASH .1
DO .1 <- #9
PLEASE STASH .1
DO .1 <- #8
PLEASE STASH .1
DO .1 <- #7
PLEASE STASH .1
DO .1 <- #6
PLEASE STASH .1
DO .1 <- #5
PLEASE STASH .1
DO .1 <- #4
PLEASE STASH .1
DO .1 <- #3
PLEASE STASH .1
DO .1 <- #2
PLEASE STASH .1
DO .1 <- #1
PLEASE STASH .1

DO :3 <- #0$#256
PLEASE FORGET .3
DO ;5  <- "!3~#4'"$#3
DO .14 <- '#0$#0'$#0
DO :3 <- #3
DO :53 <- #21
DO :1 <- #&2
DO .53 <- '#4$#1'$#0
DO .6 <- #0
DO .9 <- #2
DO :12 <- #12~.9
DO ;2 <- #2
DO .44 <- .4
DO .4 <- .44
DO COME FROM (2037)
PLEASE RETRIEVE .1
DO :6 <- #V45
DO ,2 <- #V33
PLEASE DO :9 <- !9~#2'~#5
(2037) PLEASE READ OUT .1
DO .2 <- #5
DO .2 <- #6
DO :1 <- '#1$#1'~#4
DO ;5 <- #12$#1
DO .4 <- #65535
DO .4 <- .3$#3

PLEASE GIVE UP
__________________
os: mac os 10.5.4
revision control: git
editor: emacs

site
Mad_guy is offline   Reply With Quote
Old Jul 30th, 2006, 2:20 AM   #492
B3TA_SCR1PT3R
Hobbyist Programmer
 
B3TA_SCR1PT3R's Avatar
 
Join Date: Jul 2005
Location: Dallas, Texas
Posts: 101
Rep Power: 0 B3TA_SCR1PT3R is an unknown quantity at this point
Send a message via AIM to B3TA_SCR1PT3R
409) Batch
@echo off
set x=1
:loopy
echo %x% > %TEMP%\%x%.txt
notepad %TEMP%\%x%.txt
set /a x=x+1
IF %x% neq 10 goto loopy
__________________
Hoes telling me to calm down but I'm like fuck that shit!
B3TA_SCR1PT3R is offline   Reply With Quote
Old Jul 30th, 2006, 6:02 AM   #493
v0id
Hobbyist Programmer
 
Join Date: Apr 2006
Posts: 155
Rep Power: 3 v0id is on a distinguished road
410) C++
#include <iostream>

int main()
{
    int i = 0;
    while(i != ('2'*2)/'\n')
        std::cout << ++i << static_cast<char>(32);
        
    return 0;
}
__________________
-- v0id
v0id is offline   Reply With Quote
Old Jul 30th, 2006, 1:12 PM   #494
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
You C++ people need to be a little more creative than changing around your loop conditions...

411) C++
cpp Syntax (Toggle Plain Text)
  1. #include<iostream>
  2. class c
  3. {
  4. public:
  5. c()
  6. {
  7. int i = 0;
  8. while(i++*i<100)
  9. std::cout << i << std::endl;
  10. }
  11. };
  12. c C;
  13. int main()
  14. {}
Jimbo is offline   Reply With Quote
Old Jul 30th, 2006, 1:21 PM   #495
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
ugly code, but it works...
412) C++
cpp Syntax (Toggle Plain Text)
  1. #include<iostream>
  2. int main()
  3. {
  4. int* p = new int;
  5. *p = (int)p-11;
  6. while((int)p!=++*p)
  7. std::cout<<11+*p-(int)p<< std::endl;
  8. delete p;
  9. }
Jimbo is offline   Reply With Quote
Old Jul 30th, 2006, 1:29 PM   #496
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
this is more fun than I expected....
413) C++
cpp Syntax (Toggle Plain Text)
  1. #include<iostream>
  2. int main()
  3. {
  4. int n [] = {1, 4, 12, 32, 80, 192, 584, 1024, 2304, 5120};
  5. for(int i = 0, j = i + 1; i < 10; i++, j*=2)
  6. {
  7. std::cout << n[i]/j << std::endl;
  8. }
  9. }
Jimbo is offline   Reply With Quote
Old Jul 30th, 2006, 1:34 PM   #497
v0id
Hobbyist Programmer
 
Join Date: Apr 2006
Posts: 155
Rep Power: 3 v0id is on a distinguished road
414) C++
Some exception.
#include <iostream>

class OneToTen
{
    public:
        void Loop()
        {
            for(int i = 0; i <= 10; i++)
            {
                try
                {
                    throw i;
                }
                catch(int Value)
                {
                    std::cout << Value << " ";
                }
            }
        }
};

int main()
{
    OneToTen StartThe;
    StartThe.Loop();
    
    return 0;
}
__________________
-- v0id
v0id is offline   Reply With Quote
Old Jul 30th, 2006, 1:53 PM   #498
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
415) C++
cpp Syntax (Toggle Plain Text)
  1. #include<iostream>
  2. void foo(int stop, int current = 0)
  3. {
  4. if(stop <= current)
  5. return;
  6. std::cout << ++current << std::endl;
  7. foo(stop, current);
  8. }
  9. int main()
  10. {
  11. foo(10);
  12. }
Jimbo is offline   Reply With Quote
Old Jul 30th, 2006, 2:06 PM   #499
v0id
Hobbyist Programmer
 
Join Date: Apr 2006
Posts: 155
Rep Power: 3 v0id is on a distinguished road
416) C++
#include <iostream>
#include <string>

bool Splitting(std::string &Destination, std::string &Source, char Delim)
{
   if(Source.empty())
      return false;
      
   std::string::size_type pos = Source.find(Delim);
   Destination = Source.substr(0, pos);
   
   if(pos != std::string::npos)
     Source = Source.substr(pos + 1);
   else
     Source = "";

   return true;
}

int main()
{
    std::string String = "1|2|3|4|5|6|7|8|9|10";
    std::string Stub;
    
    while(Splitting(Stub, String, '|'))
        std::cout << Stub << " ";

    return 0;
}
__________________
-- v0id
v0id is offline   Reply With Quote
Old Jul 30th, 2006, 2:07 PM   #500
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
I don't remember seeing this one...
417) C++
cpp Syntax (Toggle Plain Text)
  1. #include<iostream>
  2. int main()
  3. {
  4. int i = 1;
  5. display:
  6. std::cout << i++ << std::endl;
  7. if(i <= 10)
  8. goto display;
  9. }
Jimbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:06 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC