Login Register






[VB.Net] Programming exercises filter_list
Author
Message
[VB.Net] Programming exercises #1
Since I've came across many people who say they know VB.Net here, how about a contest? :p

What you have to do is solve the challenge with an optimized code.

Things to keep in mind.
  • Lesser words
  • No Try Catch ( instead of hiding errors, eliminate them).
  • I'm not being nazi about optimization here, so no microsecond optimization is required. A smaller code is given preference.
  • Code should only be in VB.Net

Winner will get 2 reps, and the license to brag about it for a day. Biggrin
I will decide when a challenge is over.
You cannot edit your Post, or submit a code again.
The one with the most optimized (and accurate) code will be the winner.



Challenge #1

Output required:

Code:
One 1 Two 2 Three 3 Four 4 Five 5 Six 6 Seven 7 Eight 8 Nine 9 Ten 10

Hint:
  • There are 10 spaces in between words and numbers.
  • There is no CrLf in the end.
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #2
I love sucha contests but problem is i suck in english i didint undrestand all what you wanted us to make Tongue
[Image: signature.png]


RE: [VB.Net] Optimization Challenge #3
nice contest but i don't really get what should we do... program it in command-line? use line breakers without CrLf?
Pierce the life fibers with your drill.


RE: [VB.Net] Optimization Challenge #4
Just show the output. Commandline or in textbox.
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #5
ok lets give it a try Biggrin


Code:
Public Class Form1 Sub Main() dim i as byte Console.writeline("One {0}, i.tostring) i +=1 Console.writeline("Two {0}, i.tostring) i +=1 Console.writeline("Three {0}, i.tostring) i +=1 Console.writeline("Four {0}, i.tostring) i +=1 Console.writeline("Five {0}, i.tostring) i +=1 Console.writeline("Six {0}, i.tostring) i +=1 Console.writeline("Seven {0}, i.tostring) i +=1 Console.writeline("Eight {0}, i.tostring) i +=1 Console.writeline("Nine {0}, i.tostring) i +=1 Console.writeline("Ten {0}, i.tostring) i +=1 End Sub

well im 80% sure its wrong just testing Biggrin
Pierce the life fibers with your drill.


RE: [VB.Net] Optimization Challenge #6
At least somebody tried. Smile

There is no End Class here, and the sub Main is never called, but I'll still let this one pass.

I'll wait for at least 1 more entry before announcing the result.
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #7
ok well, it's been there for enough time now. Time to spoil.
I'd love to announce hotmaster, the only contestent the winner but he was too far from the solution.

Yes, I wanted people to use a simple String Array. :p

Spoiler: Solution
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ArrItems As String() = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"} For intI As Integer = 0 To 9 TextBox1.AppendText(ArrItems(intI) & Space(10) & (intI + 1) & If(intI = 9, "", vbCrLf)) Next End Sub
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #8
oh damn... the only weakness i have besides CodeDom, Arrays >_<

i couldn't even think of it that way... such a easy way... X_X

kk give second one im excited Biggrin
(This post was last modified: 05-01-2011, 05:28 PM by Skullmeat.)
Pierce the life fibers with your drill.


RE: [VB.Net] Optimization Challenge #9
Challenge #2

Here is some output (RHS) using an algorithm on alphabets (LHS):
You have to make a function using the algorithm and display the RHS as output.

Code:
ABC = 70 BRZ = 110
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #10
time to install studio again I guess O.o
Staff will never ever ask you for your personal information.
We know everything about you anyway.