Jump to content

Coding challenge


snakey
 Share

Recommended Posts

For me it did I was trying to write it in python and then when I learned it could be sys calls of anything to convert and we had to use an API it died then. New Challenge maybe?

Several Ideas for a Challenge:

LANGUAGE for all Python preferably though other languages perfectly fine!

Monitor a given web page of part of a web page for a change

or

A dashboard clone for linux or windows or both

or

Get a playing video's packets and re-assemble them (harder? Videos that don't cache etc.)

--This is probably the hardest by a lot.

Link to comment
Share on other sites

  • Replies 237
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Is there nobody interested in this anymore? I quiet enjoyed readin what was going on and trying to glean a little knowledge from those that posted. Hopefully I will be able to play along myself within the next few months since I am just gettin started learning how to program.

Link to comment
Share on other sites

--Easy challenge--

create some CSS to this html file best looking web site wins

time to complete 2 weeks

Challenge.html

<html>
<title>
CSS challenge
</title>
<body>
<h1> Welcome to the CSS challenge</h1>
<H3>Reason for this challenge</h3>
<p>The reason for this challenge is to help people learn CSS and to keep the <b>hak5</B> coding challenge alive</P>
<h3>Kickflip</h3>
<p>The Kickflip (originally Magic Flip) is an Aerial Skateboarding Trick where the Skateboarder kicks his Skateboard in order to make it flip 360 degrees along the board's long axis. The modern Kickflip was invented by Rodney Mullen in 1983.
A Kickflip is executed similarly to the Ollie, and like the Ollie, it has become a defining trick of "New School" Skateboarding. The Kickflip has been ported over to other boardsports, notably Surfing, Snowskating, Wakeskating, and Skimboarding.</p> 
<a href=www.google.com>Awsome Search engine</a>
</body>
</html>

ok give that some pretty colours and alignment

CSS tutorials can be found at htmldog.com

Real easy to learn so even if you dont know CSS you can do this challenge in 10 minutes

Link to comment
Share on other sites

I had to have an attempt at the Text Adventure one. I used VB.NET Console App.

The game is Munchkin is ever you have played it, the idea of the game is to get to level 10. If your level and your bonuses are equal to or higher than the monsters then you level up, if you fight the monster and lose then you level down. If you try to run away from a high level monster then there's a 1/3 chance it will catch up and engage in combat.

have fun :D

Imports System.Console

Module Module1
    Dim CharName As String
    Dim CharLevel As Integer = 1
    Dim ItemBonus As Integer = 0
    Dim MonsterLevel As Integer

    Sub Main()
        Dim PeakLevel As Integer
        Dim DungeonRoom As Integer = 0
        Randomize()
        WriteLine("Welcome to Munchkin.")
        WriteLine()
        WriteLine("Name your munchkin:")
        CharName = ReadLine()
        Clear()
        WriteLine("Munchkin " + CharName + ", press any key to break down your first door...")
        ReadLine()

        While CharLevel > 0 And CharLevel < 10
            Clear()
            DungeonRoom = DungeonRoom + 1

            If CharLevel > PeakLevel Then
                PeakLevel = CharLevel
            End If

            WriteLine("Munchkin " + CharName + " is now level " + CharLevel.ToString)
            WriteLine("Your items give you an attack bonus of " + ItemBonus.ToString)
            WriteLine()
            WriteLine("You break down the door and see...")
            WriteLine()

            If Encounter(d(4)) = True Then
                Fight()
            End If

            WriteLine()
            WriteLine("You see a door n front of you")
            WriteLine("Press any key to break down the door...")
            ReadLine()
        End While

        If CharLevel <= 0 Then
            Clear()
            WriteLine("Munchkin " + CharName + " died.")
            WriteLine()
            WriteLine("Highest Level Achieved:" + PeakLevel.ToString)
            WriteLine("Doors Kicked Down: " + DungeonRoom.ToString)
            WriteLine()
            WriteLine("THE END")
            ReadLine()
        ElseIf CharLevel = 10 Then
            Clear()
            WriteLine("You reached Level 10!")
            WriteLine()
            WriteLine("Doors Kicked Down: " + DungeonRoom.ToString)
            WriteLine()
            WriteLine("THE END")
            ReadLine()
            End
        End If
    End Sub

    Function d(ByVal e As Single)
        Dim Result As Integer = CInt(Int((e * Rnd()) + 1))
        Return Result
    End Function

    Function Encounter(ByVal e As Integer)
        Dim isMonster As Boolean
        Select Case e
            Case 1
                MonsterLevel = CharLevel + d(10)
                WriteLine("A Level " + MonsterLevel.ToString + " Monster!")
                isMonster = True
            Case 2
                WriteLine("A Level " + CharLevel.ToString + " Monster!")
                isMonster = True
            Case 3
                WriteLine("Wax On! Wax Off! A wisened old man teaches you his ways, LEVEL UP!")
                isMonster = False
                WriteLine()
                LevelUp()
            Case 4
                WriteLine("A +1 Potion of Ubernessnessness........ness")
                isMonster = False
                ItemBonus = ItemBonus + 1
        End Select
        Return isMonster
    End Function

    Sub LevelUp()
        CharLevel = CharLevel + 1
        WriteLine("CONGRATULATIONS!!!")
        WriteLine()
        WriteLine("Munchkin " + CharName + " has acheieved level " + CharLevel.ToString)
    End Sub

    Sub LevelDown()
        CharLevel = CharLevel - 1
        WriteLine("YOU NEED NOOB LUBE!!!")
        WriteLine()
        WriteLine("Munchkin " + CharName + " got pwned and is now level " + CharLevel.ToString)
    End Sub

    Sub Fight()
        Dim CHOICE As Integer
        WriteLine()
        WriteLine("1. CHAAAAAAAAAAAARRRRRGE!")
        WriteLine("2. Cry like a girl and run.")
        CHOICE = Val(ReadLine())
        Clear()
        Select Case CHOICE
            Case 1
                If CharLevel + ItemBonus >= MonsterLevel Then
                    LevelUp()
                Else
                    LevelDown()
                End If
            Case 2
                Flee()
        End Select
    End Sub

    Sub Flee()
        Dim i = d(6)
        If i <= 2 Then
            Clear()
            WriteLine("The monster caught up with you!")
            If (CharLevel + ItemBonus) >= MonsterLevel Then
                Clear()
                LevelUp()
            Else
                LevelDown()
            End If
        Else
            Clear()
            WriteLine("You got away... this time!")
            WriteLine()
        End If
    End Sub

End Module

It's only a very quick rendition, I'd love to develop it more.

Link to comment
Share on other sites

Erm, writing CSS isn't programming, its web design.

i have to disagree with u there, u use the css programming language to design web pages, just as u use say java to design software. ur still having to write the script that the computer reads to do a set of instruction. so it is programming.

Link to comment
Share on other sites

i have to disagree with u there, u use the css programming language to design web pages, just as u use say java to design software. ur still having to write the script that the computer reads to do a set of instruction. so it is programming.

I'm not doubting that both are 'designing', however the designing activity is not programming for creating a document that describes the look of another document. Just like if you were designing a building, your not programming it, you'll be drawing and using CAD products.

By your definition someone using Microsoft Word is now a programmer, if they export to a html page with css. Ok they used a tool to do it, but they still produced the document, I used a program for programming, an IDE.

I'm not saying that people who create nice css and html with pretty pictures aren't any less talented than me with being able to program. But the activity is not programming and won't be until CSS can have some sort of control flow, logically expression and different types amongst other things.

If you want to call yourself a programmer for doing css, then your basically as bad as the media as using hacker to mean an evil person that breaks the law using a computer.

Link to comment
Share on other sites

  • 2 weeks later...

hmm, things tend to move very slowly on these challenges, especially more lately. hmm i have a quick thought. maybe we should request a subforum here so that we can post different challenges, and keep them organized and so we can have more then one challenge going on at one time, and people can choose what they thing is cool. this would also keep things more organized and allow a greater variety of things to do for people of all levels of experience.

a greater variety might help keep things going, allowing people to do more then one challenge at once.

idk, just a thought, seemed good at the time.

Link to comment
Share on other sites

i have a challenge if any one is up to it.(i know its suppose to be giving by the winner of the last challenge but just thought I'd give this challenge anyway )

lang: any

challenge: create a program that runs a basic Caesar cipher ( takes the letters of the alphabet and moves then over a set number of positions example: a ->b , b->c ....etc...)

to win: who ever can write the most efficient and short code *hint* if you know the right method this shouldn't take more than a few lines of code .

time : 1 .5 weeks

Link to comment
Share on other sites

import Char
ceasershift :: [Char] -> Int -> [Char]
ceasershift [] offset = []
ceasershift (ch : chs) offset
        | not (isAlpha ch) = ceasershift chs offset
        | isUpper ch = [chr (ord 'A' + (mod (ord ch - ord 'A' + offset) 26))] ++ ceasershift chs offset
        | isLower ch = [chr (ord 'a' + (mod (ord ch - ord 'a' + offset) 26))] ++ ceasershift chs offset

I was trying to get it into a single line using a list comprehension but can't think of handling upper and lower cases in it nicely.

Link to comment
Share on other sites

This thread is a coding challenge, not a programming challenge thread, therefore CSS falls into the category of coding. Have a nice day.

Definition: Coding - The process of translating a solution to a problem from an algorithm in human language (e.g., English to) a programming language that a computer can understand.

Computer programming (often shortened to programming or coding) is the process of writing, testing, debugging/troubleshooting, and maintaining the source code of computer programs. This source code is written in a programming language. The code may be a modification of an existing source or something completely new. The purpose of programming is to create a program that exhibits a certain desired behavior (customization). The process of writing source code often requires expertise in many different subjects, including knowledge of the application domain, specialized algorithms and formal logic.

Couple of good definitions that will hopefully help you understand and not make the same mistake again. The second one is directly from wikipedia, the first one being from an american unveristy.

This also might help you: List of Programming Languages

Link to comment
Share on other sites

Everyone has their own opinion. CSS has it's own syntax, and is interpreted by a web browser to style a web page. Next you'll say interpreted languages aren't programming.

Computer programming (often shortened to programming or coding) is the process of writing, testing, debugging/troubleshooting, and maintaining the source code of computer programs. This source code is written in a programming language. The code may be a modification of an existing source or something completely new. The purpose of programming is to create a program that exhibits a certain desired behavior (customization). The process of writing source code often requires expertise in many different subjects, including knowledge of the application domain, specialized algorithms and formal logic.

I would like to point out web sites are web applications, therefore fall into this category. The fact you had to put the person down by saying "CSS isn't programming" only shows you're here to try to make yourself look better than everyone else. Everyone on this forum are too quick to find an opportunity that makes themselves look better than everyone else, stroking their egos.

Link to comment
Share on other sites

Web sites arn't web applications, web applications are web applications and they create dynamic user driver content depending on a set of inputs. CSS and HTML are static, with an extremely limited 'interactiveness' such as mouse over events.

CSS has its own syntax yes and is intepreted, however the english language has a syntax and you interpret it by reading it or hearing it, that doesn't make it a programming language.

If you read my previous posts on this arguement, you'll understand that I don't think of talented web designers as any less than programmers, I certainly wish that I could do wonderful designs but thats not where I've spent my time.

However like the difference betwen walking and running, CSS and HTML are not programming languages and never will be because that is not their job.

I'm here for a lot of reasons, if you check my member number you'll see that I've been around for a long time as well, I don't try to put people down, but I tire quickly. I would much rather have interesting and interlectual conversations all the time, rather than reiterating a previously discuessed and documented debate to every single new person that comes along.

If you would like to settle this and win the arguement, take the last challenge posted (which I submitted a quick solution to already) to create a Ceaser Shift function, which takes a string and an integer to offset each character by (assuming only cycle through the alphabet) that returns the offset string in only HTML and CSS, consider the arguement yours and probably 1337 as you sound like the person that would like to be called that. As previously mentioned, it is an extremely simple algorithm.

Link to comment
Share on other sites

import Char
ceasershift :: [Char] -> Int -> [Char]
ceasershift [] offset = []
ceasershift (ch : chs) offset
        | not (isAlpha ch) = ceasershift chs offset
        | isUpper ch = [chr (ord 'A' + (mod (ord ch - ord 'A' + offset) 26))] ++ ceasershift chs offset
        | isLower ch = [chr (ord 'a' + (mod (ord ch - ord 'a' + offset) 26))] ++ ceasershift chs offset

I was trying to get it into a single line using a list comprehension but can't think of handling upper and lower cases in it nicely.

that's a really interesting way of writing this code, never seen it like that .

oh and the way i would describe the difference between css and a language like c++ is this:

css is like art design , you get an idea of what you want something to look like then you "draw" it , your brush jsut happens to be a set of orders in a script

C++ on the other hand is like an engineering problem , you want a machine to have a certain function (example: want it to do more than look pretty) you have to build all the parts , put them together right, and then make sure it works with out to many errors .

Link to comment
Share on other sites

huh, i will have to check this language out , sounds interesting. and once this holiday week is over i think i will show off my implementation of the Caesar cipher XD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...