Batch

The ubiquitous operating system, discussion of its (many) flaws, and how to mitigate the risks of those flaws

Re: Batch

Post by anonHacker on Sun Jul 27, 2008 9:36 pm
([msg=8492]see Re: Batch[/msg])

HELP is your friend. See HELP SET and HELP FOR. Good readings, there.

Also, my script is, of course, a bit complicated. :-)

Finish programming 1 and I'll show you my code. If you really want to do it in batch, I'll warn you in advance that you wont just need to be able to make a batch that can do the job, but one that can do the job quickly.
anonHacker
Experienced User
Experienced User
 
Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Sun Jul 27, 2008 9:42 pm
([msg=8493]see Re: Batch[/msg])

ugh... this is gonna be hard... well once I figure out how to break the words into letters, I know how to do the solving. Theres a formula that uses prime numbers to find the anagram. I just need to know how to take input from set and break it into multiple variables.
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Re: Batch

Post by anonHacker on Sun Jul 27, 2008 9:45 pm
([msg=8494]see Re: Batch[/msg])

HELP SET explains how you can get a substring out of a variable. Coupled with delayed variable expansion, you can use loops to break it up for a character by character basis.
anonHacker
Experienced User
Experienced User
 
Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Sun Jul 27, 2008 9:52 pm
([msg=8495]see Re: Batch[/msg])

ahhhhh... now I see. So Im gonna need to start with %var:~0,1% right?

I managed to make a program that assigns each letter a prime number and the multiplies all the number to get one total. This is a new method i read about for solving anagrams. Apparently since prime numbers cant be made from other numbers.... they work wonders for checking if two words are made up of the same letters. My program verifies that this works. hello, ohell, and lehol all equal 13447687
[Code removed]
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Re: Batch

Post by anonHacker on Mon Jul 28, 2008 6:02 am
([msg=8510]see Re: Batch[/msg])

In answer to your question, yes.

And, that's some interesting code you made there. Personally, I didn't use a method like that, but simply devised my own solution.

Also, lol, that code is single handedly more than four times as long as all the code I used for my solution put together.
anonHacker
Experienced User
Experienced User
 
Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Mon Jul 28, 2008 10:31 am
([msg=8525]see Re: Batch[/msg])

ugh.... okay... i can take input and break it down... now how do I get it to read wordlist and compare the words? I need to open each word and run it through to find its number.. then compare it to the prime total of the first word.
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Re: Batch

Post by anonHacker on Mon Jul 28, 2008 12:45 pm
([msg=8553]see Re: Batch[/msg])

See HELP FOR with particular emphasis on the /F flag. :-)
anonHacker
Experienced User
Experienced User
 
Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Mon Jul 28, 2008 2:37 pm
([msg=8569]see Re: Batch[/msg])

Well that would have been helpful this morning. Anyway... I found a way around it that doesn't even use wordlist.txt.
Its over 90,000 chars long.. so I cant post the code. lol... anyway.... ill just upload the files and post the link.
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Mon Jul 28, 2008 2:45 pm
([msg=8573]see Re: Batch[/msg])

[Removed]

On my desktop it unscrambles 9 words in about 3 seconds. The problem is not the program, but the human aspect. I can't seem to put the word in fast enough. See you open checkrun.bat and paste all the scrambled words in one line seperated by spaces. This makes each one a variable going into check.bat which then outputs all possible anamagrams into solved.txt. However, when copy from HTS the words look like this:

# word1
# word2
# word3

and getting them to look like

word1 word2 word3

takes too long.

and then when they are outputted they look like

unscrambled1
unscrambled2
unscrambled3


which then must be made into

unscrambled1,unscrambled2,unscrambled3


this takes too long to meet the 30 sec time limit. Any help?
Im soooooo close.
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Re: Batch

Post by beagle on Fri Aug 01, 2008 11:13 am
([msg=8612]see Re: Batch[/msg])

I made a calculator in batch:

@echo off
title Batch Calculator by Beagle
color 1f
:top
echo --------------------------------------------------------------
echo Welcome to Batch Calculator by Beagle
echo --------------------------------------------------------------
echo.
set /p udefine=
set /a udefine=%udefine%
echo.
echo = %udefine%
echo --------------------------------------------------------------
pause
cls
echo Previous Answer: %udefine%
goto top
pause
exit
011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)


PreviousNext

Return to Microsoft Windows

Who is online

Users browsing this forum: No registered users and 0 guests