Page 4 of 4 FirstFirst ... 234
Results 31 to 34 of 34

Thread: Beginners programming challenge #28

  1. #31
    Join Date
    May 2007
    Location
    Leeds, UK
    Beans
    1,664
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: Beginners programming challenge #28

    Not a beginner submission, but they seem few and far between now so here's a little Java solution. Functions you say? Functions (or methods) aplenty here!

    I've left all classes in the default package to make compiling it easier without a Java IDE. I suppose I could have used java.net.InetAddress to format the IP address but I was writing the MAC address formatter anyway. Note the .bin filenames need to be passed on the command line -- it doesn't check and display a usage message.

    Here's a compile and test run:
    Code:
    $ ls
    ARPPacket.java  Driver.java  EthernetFrame.java  NetDump.java  reply.bin  request.bin
    $ javac *.java
    $ java Driver request.bin
    request.bin
    
    Ethernet Header
    ---------------
    Source MAC Address: ca:01:33:65:00:08
    Destination MAC Address: ff:ff:ff:ff:ff:ff
    Ethernet Frame Type: 0x0806
    
    ARP Packet
    ----------
    Hardware Type: 0x0001
    Protocol Type: 0x0800
    Hardware Size: 0x06
    Protocol Size: 0x04
    Opcode: 0x0001
    Sender MAC Address: ca:01:33:65:00:08
    Sender IP Address: 192.168.1.1
    Target MAC Address: 00:00:00:00:00:00
    Target IP Address: 192.168.1.2
    Attached Files Attached Files

  2. #32
    Join Date
    Dec 2007
    Location
    Behind you!!
    Beans
    977
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Beginners programming challenge #28

    Morning all, it's great to see people stepping in to keep these challenges going. Now, we haven't had a reply to this thread for quite a while, and I've been unable to get in touch with Bachstelze. We also only had 1 beginner entry, which kind of makes judging relatively easy
    Despite this, the entry in question displayed good use of functions, readable code and although the comments were a bit thin they were used correctly; by that I mean they were used to tell the reader why something was being done, not how something was being done.

    The winner is.
    .
    .
    .
    ***CoyleTrydan***

    Congratultations, I look froward to seeing the next challenge.

    Good work from everyone,
    Happy coding!
    Bodsda,
    Ubuntu Beginners Team
    computer-howto
    Linux is not windows
    Fluxbox & Flux menu how to
    Programming is an art. Learn it, Live it, Love it!


  3. #33
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Beginners programming challenge #28

    Quote Originally Posted by Bodsda View Post
    and I've been unable to get in touch with Bachstelze.
    Oh, sorry about that, I'm not visiting the forum much these days, and I don't get email notifications when I have a PM...
    「明後日の夕方には帰ってるからね。」


  4. #34
    Join Date
    Sep 2011
    Beans
    10

    Re: Beginners programming challenge #28

    Cool! Thanks Bachstelze for putting this challenge together. Though I struggled at times to figure some parts out, it really taught me some useful stuff, and I enjoyed it a great deal. Thank you Bodsda for your kind words about my entry.

    I'm not sure I'm really qualified to put together the next challenge, but I'll give it a bit of thought and talk with Bodsda some privately.

Page 4 of 4 FirstFirst ... 234

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •