5 Replies - 15209 Views - Last Post: 11 August 2011 - 12:25 PM

#1 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Check Out: 100 Lines or Less

Post icon  Posted 10 August 2011 - 05:34 PM

Now here's your chance to show off your Masterpieces of Code containing 100 lines of code or less.

Restrictions & Requirements

A declaration of your LOC.
Example. 42 LOC

You must include all of the options settings need to run. (Not counted in LOC)
Example
Option Strict On
Option Infer On
Option Compare Text
Option Explicit On



You must include at the each code file the follow comments (but with you username)
These are not counted
'
' Check Out: 100 Lines or Less 
'
' DIC Username: AdamSpeight2008
' 



You must also state which version of the runtime / framework you are using.

This is compiled using .net 4.0 Client Profile

Comment not included in LOC.
Blank Lines are counted.
Lines Length must be reasonable and not excessive in length. (Judges discretion on what is deemed reasonable)
Assume it being read with a 10 point mono-spaced font. Guide: more 3 off bar clicks will be starting to be consider as excessive.

Controls and Variable names must meaningful.
So Textbox1 would be a mark off.


External References
Not allowed, except if is part of the standard framework you are using. So if you want to use RX, it not allowed as it not part of the standard framework. But System.Numerics is as part.
If you're code requires other software or an application to be installed also not allowed.
Note: If you use something other than the automatically imported Namespaces, then that name must be included in your code and counts toward your LOC

Example
Using System.Runtime.CompilerServices


Namespace aliasing is allowed (and counts towards the LOC)
Example
Imports IE = System.Collections.IEnumerable



Assume that the user is a fresh install of Windows 7 and has just Visual Studio or an Express Edition installed.

Form Class
If your code display forms, the auto-generated created by the GUI Designer won't be counted.
Example:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.SuspendLayout()
        '
        'TextBox1
        '
        Me.TextBox1.Location = New System.Drawing.Point(13, 32)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(100, 20)
        Me.TextBox1.TabIndex = 0
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(284, 262)
        Me.Controls.Add(Me.TextBox1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox

End Class




Include a Copy of Project as a Zip, 7Zip file, or Link to where the project can download.
No links to Naked Binarys.

Should work under a Standard User.
So not need Elevated privileges or admin rights.

The user only can save to their My Documents
So no saving to the C directory. Or hard coded locations.

Cheating
Any cheating found will result in a down vote(s).
Examples of cheating. (Not exhaustive)

- Failing to following any of the above.
- Claiming someone else work as your own.


So let see you Masterpieces of 100 LOC or Less

Is This A Good Question/Topic? 1
  • +

Replies To: Check Out: 100 Lines or Less

#2 biggerB  Icon User is offline

  • If at first you don’t succeed, call it version 1.0
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Check Out: 100 Lines or Less

Posted 11 August 2011 - 08:42 AM

Program Name: Comparer 2 (1 was a bust)
Framework: .Net 3.0

Takes two images and compares them to see how much percentage of those two images is similar. On 66 Lines of Code. (according to the above rules)

I tried to follow all the rules above, completed in about 2 Hours..



PS. This program requires two Bitmap images to compare, try these two as a test.
http://www.mylifeisb...11/08/Test2.bmp
http://www.mylifeisb...11/08/Test1.bmp

Attached File  Comparer 2.zip (71.64K)
Number of downloads: 110

This post has been edited by biggerB: 11 August 2011 - 10:49 AM

Was This Post Helpful? 1
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: Check Out: 100 Lines or Less

Posted 11 August 2011 - 09:31 AM

Here's my first submission.


Program Name: Calc
Description: A Calculator in 54 LOC
Framework: .net 4.0 (Client Profile)

Attached File  DIC_100LOC_Calc.zip (86.95K)
Number of downloads: 92
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: Check Out: 100 Lines or Less

Posted 11 August 2011 - 09:45 AM

biggerB: A Point off for recommending JPGs when your program only can load BMPs.

Note: You can judge the other entries and award and detract points.

This post has been edited by AdamSpeight2008: 11 August 2011 - 09:49 AM

Was This Post Helpful? 0
  • +
  • -

#5 biggerB  Icon User is offline

  • If at first you don’t succeed, call it version 1.0
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Check Out: 100 Lines or Less

Posted 11 August 2011 - 10:48 AM

Actually they were Bitmaps when I uploaded them, Photo Bucket must have changed them, I reset the links to files I uploaded onto my own site. Thanks for pointing that out..

This post has been edited by biggerB: 11 August 2011 - 12:16 PM

Was This Post Helpful? 0
  • +
  • -

#6 biggerB  Icon User is offline

  • If at first you don’t succeed, call it version 1.0
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: Check Out: 100 Lines or Less

Posted 11 August 2011 - 12:25 PM

AdamSpeight2008 There is no limitation to the amount of digits that can become the result of a calculation, So if you do the calculation, 1000000000000000 * 1000000000000000, the decimal used for the result overloads. 1 point off.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1