Machines And You Headline Animator

Machines And You

NEW

Follow us for more. Know more about mobile phones or Computers. Click here to register to our official web site.

Search This Blog

Friday 20 May 2011

World's Top 10 Tablet PCs




Follow us for more. Click here to register to our official web site.






It’s about that time folks – the time to run down the Top 10 tablets that we’re expecting to see in 2011. Now that the flood gates on this year’s wave of high-powered tablets aimed at the heart of Apple’s iPad, we know more about what 2011 will bring us in the tablet space. We previously showed you which tablets to look for in our top tablet countdown, but with all the recently announced hardware, we decided to add an extra five spots to the list.

Whether it’s Android OS, webOS, iOS, or QNX, the new generation of tablets is surely going to please.

10. HTC Scribe


Yeah, we know, we don’t know much about this device right now. But, it still deserves a spot on this list, albeit the last spot (due to incomplete specs and availability info). HTC does some remarkable work with their hardware, and if they dive into the tablet market, we wouldn’t expect anything less than an extraordinary tablet. One thing we’ll love to see from this tablet is a tablet-optimized version of the Sense UI, which runs atop Android OS. We can expect to see things like an NVIDIA Tegra 2 dual-core chipset, 1280 x 720 resolution, 2 GB of internal memory, a 32 GB micro SD card, and a handful of more features. Until we hear more about the Scribe, it’ll sit at number 10 for now.

9. Acer Iconia A500



Acer’s upcoming Honeycomb tablet looks like it will be pack quite the punch with a 10.1 inch display, Intel Sandy Bridge processor, Verizon 4G LTE support, HDMI port and 1080p video out. Acer touts this tablet as the perfect gamer’s device, and the hardware onboard would certainly support that statement. There’s no official release date for this tablet, but we can expect it sometime in the very near future as Verizon begins to ramp up their LTE network in the coming months. Even Acer’s Froyo tablets are very nice, and I’d pick one up before the Galaxy Tab any day, even without the Android Market.

8. Toshiba Tablet




Way to step it up, Toshiba. We caught a glimpse of this device at a party during CES, and we were very impressed with the hardware. The device was running Froyo, but we’ll see this thing running Honeycomb once it actually ships. This powerfully-spec’d tablet comes with a 10.1 inch display with a resolution of 1280 x 800, NVIDIA Tegra 2 processor, 5 megapixel camera on the back, and a 2 megapixel camera on the front for video-chatting. The unnamed tablet also sports a full-sized SD card slot, HDMI port, 1080p HD video output. The backing of the tablet uses a rubberized material, called EasyGrip, which will also be replaceable. You can also replace the battery in this device as well, just in case you’re a power user. One thing is for sure, this tablet is no Folio.

7. Dell Streak 7





Dell has had the Streak available a while now, with lackluster results. This year, it looks like the computer maker is stepping up their game with the upcoming Dell Streak 7 tablet. Expected to hit T-Mobile in the near future, The Streak 7 is a 7 inch (WVGA resolution), Android 2.2 tablet that sports HSPA+, and may sit nicely next to the G-Slate as a smaller, more portable alternative. The Streak 7 tablet comes with a 5 megapixel camera on the back, and a 1.3 megapixel camera on the front for video chatting. Along with most of the other tablets on this list, the Streak 7 will ship with NVIDIA’s Tegra 2 dual-core chipset, making it more than capable of handling virtually any media you throw at it. We’re glad to see Dell is taking the tablet market seriously now, and hopefully we’ll see the Streak 7 get bumped up to Honeycomb soon after its release.

6. Samsung Galaxy Tab 2



Samsung’s Hummingbird processor 
not fast enough for you? That’s OK, as Samsung will soon be bringing us a dual-core version of their 7 inch Android tablet. While we may see another Tegra 2 in the tablet, there’s also a chance that we may see Samsung’s own dual-core Orion chipset onboard. Samsung has their ARM Cortex A9-based Orion chip in the works, but it’s looking likely that it won’t be ready in time for the likes of the Galaxy Tab 2. Another thing to look forward to on the Galaxy Tab 2 is that is just may ship with Samsung’s popular Super AMOLED display, giving it a crisp and clear experience throughout. Since we’ve seen what Honeycomb brings to the tablet, we’re sure everyone will be more than disappointed if this tablet shipped with anything less than Honeycomb. Rumored to be announced at Mobile World Congress next month, it sounds like we may be hearing more about this tablet very soon.



5. BlackBerry PlayBook


RIM’s very first tablet, the BlackBerry PlayBook, is shaping up to be quite the powerhouse. Many were doubting that RIM could bring a quality tablet to market, but they have done just that, and the Playbook is a great device that could even appeal to                         non-enterprise users. This 7 inch tablet also comes with a dual-core CPU, but it’s from Texas Instruments, and not NVIDIA this time around. In addition to its multi-core CPU, the Playbook also sports 1 GB of RAM, HDMI port, 1080p HD video playback, and a handful of other features you’d expect from a quality tablet. Shipping with Sprint’s 4G under the hood, the Playbook will fly in more than one way when it’s released.

4. WebOS Tablets




One of the most anticipated tablets, by far, would have to be the WebOS tablets, the Topaz and Opal. Most of the tablets in this countdown are running Android, but the introduction of a WebOS tablet certainly appeals to most of us here at IntoMobile. Coming in 9 and 7 inch versions, these tablets will have the ultra-slick, HP-refined, WebOS onboard in all it’s deck-of-cards, multitasking glory. While I’m looking forward to Android Honeycomb, I’m pretty much equally excited to see WebOS on a bigger screen.


3. Motorola Xoom


The Motorola Xoom will be the very first Android Honeycomb tablet to actually ship to customers, and it’s coming your way through Verizon Wireless. A WiFi-only version will eventually surface, but until then, you’ll have to go through Big Red. This 10.1 inch monster features Android 3.0 Honeycomb, NVIDIA’s 1 GHz dual-core Tegra 2 chipset, a 5 megapixel camera on back, a 2 megapixel camera on the front, HDMI port with 1080p HD video support. Add in the built-in gyroscope, barometer, e-compass, accelerometer and adaptive lighting, and you have one beast of a tablet. Although it’s upgradable to 4G LTE with optional add-on hardware, the Xoom will not ship with Verizon’s 4G LTE out of the box, so you’ll have to wait until Q2 before you can taste that kind of speed.


2. LG G-Slate




T-Mobile will carry the second Android Honeycomb tablet, the G-Slate. Made by LG, we’re expecting a spec sheet similar to that of the Motorola Xoom, but there’s one thing that bumped this tablet to number 2. The G-Slate ships with T-Mobile’s HSPA+ 4G network out of the box, and won’t require any sort of hardware upgrade in order to “xoom” along the wireless internets at broadband-like speeds. We know LG decided to wait until Android 3.0 before shipping their tablet, and it looks like the waiting has paid off. The G-Slate may not be too far off, either, as we’ve seen a mysterious LG tablet device with Magenta’s AWS bands already passing through the FCC. The G-Slate is one of many awesome devices LG is about to begin shipping this year, and we can’t wait to get our hands on this thing.


1. Apple iPad 2




This should be no surprise to anyone, but the crown of tablets will be given to Apple’s next generation iPad. The rumored specs on the iPad 2 are absolutely ridiculous, almost to the point of hilarity, and that only makes us more excited to see what’s in store for the second-generation iPad. It may not have the Retina Display that we were hoping for, but some rumors indicate that the iPad 2 will still likely use a display with higher resolution than the current iPad. We could possibly also see the iPad 2 getting a multi-core processor, and SD card slot for more storage. Apple likes to keep their products under wraps, so we have to wait a bit longer until we see the real power behind the most popular tablet’s successor.




N.B.: This post contains names of various product of their respective owning companies. This site i.e., Machines and you  do not own any share of these products and is just showcasing them for catering knowledge to its readers. The ownership remains with the respective owners.




Hope you have liked our post.
Comment.
Follow.
Rate.
Enjoy ..!!!

Saturday 14 May 2011

Make Your Own Countdown Timer





Follow us for more. Click here to register to our official web site.



Hi friends,
 
Today I am here to give you all the process of making a Countdown
Timer.  This application can count days, hours, minutes and seconds.
This would be very useful as you do not need install any softwares. 

 
This is very easy to make since I have provided you with the coding. 
 
IMPORTANT INSTRUCTIONS :
  • Copy the text given below in the scrollbox.
  • Make a new Text file by clicking on Start >
     All Programs > Accessories > Notepad.
  • Paste the entire code in the new text document.
  • Click on File > Save As > Change "Save As Type" 
    to "All Files".
  • Give the file name Hit The Timer.bat
    [N.B.: Do not forget to give the extension as .bat]
  • Click on Save.
  • Now double-click to Play the game. 


@echo off
setlocal enabledelayedexpansion
if /i "%1"=="lol" (goto secondaryrun)
if /i NOT "%1"=="" (
set input=%1 %2 %3 %4 %5
goto gotinput
)
:Firstrun
echo.
echo Enter how many seconds, minutes, hours and days should be waited
echo Add switch "/b" to make the timer run in the background, with no open window
echo Syntax: [/S:Seconds] [/M:Minutes] [/H:Hours] [/D:Days] [/b]
set /p input=""
if not defined input (
cls
goto Firstrun
)
:gotinput
for %%I in (%0) do set filename=%%~sI
for /f "tokens=1,2,3,4,5" %%I in ("%input%") do set input1=%%I& set input2=%%J& set input3=%%K& set input4=%%L& set input5=%%M
echo Now enter the command to be executed when the time runs out
set /p wtd=
echo.
echo Setting up...

set x=0
set fv=/S:
set VN=Seconds
call :sort

set /a seconds=%seconds:~3%
if not defined seconds (set seconds=0)
if /i not %seconds% leq 99 (set seconds=0)
if /i not %seconds% gtr 0 (set seconds=0)

set x=0
set fv=/M:
set VN=Minutes
call :sort

set /a minutes=%minutes:~3%
if not defined minutes (set minutes=0)
if /i not %minutes% leq 99 (set minutes=0)
if /i not %minutes% gtr 0 (set minutes=0)

set x=0
set fv=/H:
set VN=Hours
call :sort

set /a hours=%hours:~3%
if not defined hours (set hours=0)
if /i not %hours% leq 99 (set hours=0)
if /i not %hours% gtr 0 (set hours=0)

set x=0
set fv=/D:
set VN=Days
call :sort

set /a days=%days:~3%
if not defined days (set days=0)
if /i not %days% leq 99 (set days=0)
if /i not %days% gtr 0 (set days=0)

set x=0
set fv=/b
set VN=invis
call :sort

if /i "%invis%" neq "/b" (
set invis=
)

goto gotsecs

:Sort
set /a x= %x% + 1
echo !input%x%! | find /i "%fv%" >nul
if /i %errorlevel% equ 0 (
set %VN%=!input%x%!
exit /b
)
if %X%==5 (
exit /b
)
goto sort



:invismaker
set randomnumber=%random%
for /f "delims=" %%J in ("CreateObject("Wscript.Shell").Run "" & WScript.Arguments(0) & "", 0, False") do echo %%~J > %temp%\%randomnumber%waiting.temp
echo %wtd% > %temp%\%randomnumber%wtd.temp
Wscript.exe //e:vbscript "%temp%\%randomnumber%waiting.temp" "%filename% lol %counter% %randomnumber%"
del %temp%\%randomnumber%waiting.temp
echo.
echo Timer Running.
exit /b


:gotsecs
Set OriginalTime=%time%
set /a counter= %seconds% + ( %minutes% * 60 ) + ( %hours% * 3600 ) + ( %days% * 86400 )
if /i %counter% equ 0 goto finish
set checktime= %time:~7,1%
if defined invis (
goto invismaker
)
goto timecheck

:secondaryrun
set checktime= %time:~7,1%
set counter=%2
set randomnumber=%3
for /f "delims=" %%I in (%temp%\%randomnumber%wtd.temp) do set wtd=%%I
del %temp%\%randomnumber%wtd.temp

:Timecheck
if /i %checktime% equ %time:~7,1% (goto timecheck)
Set /a counter= %counter% - 1
set /a checktime= %time:~7,1%
goto display


:display
set /a daysremaining= %counter% / 86400
if /i daysremaining GEQ 10 (
set /a daysremaining= %daysremaining:~0,2%
) ELSE (
set /a daysremaining= %daysremaining:~0,1%
)

set /a hoursremaining= ( %counter% - ( %daysremaining% * 86400 ) ) / 3600
if /i hoursremaining GEQ 10 (
set /a hoursremaining= %hoursremaining:~0,2%
) ELSE (
set /a hoursremaining= %hourssremaining:~0,1%
)

set /a minutesremaining= ( %counter% - ( %daysremaining% * 86400 ) - ( %hoursremaining% * 3600) ) /60
if /i minutesremaining GEQ 10 (
set /a minutesremaining= %minutesremaining:~0,2%
) ELSE (
set /a minutesremaining= %minutesremaining:~0,1%
)

Set /a secondsremaining= %counter% - ( %hoursremaining% * 3600 ) - ( %minutesremaining% * 60 ) - ( %daysremaining% * 86400 )


cls
Echo Started Waiting...
Echo Days Remaining: %daysremaining%
Echo Hours Remaining: %hoursremaining%
Echo Minutes Remaining: %Minutesremaining%
Echo Seconds Remaining: %secondsremaining%
if /i %counter% equ 0 (goto finish)
Echo To Pause Timer, Press Pause Break, to resume press Enter.
goto Timecheck

:finish
Set Endtime=%time%
echo Time Waited: %days% Days, %hours%:%Minutes%:%Seconds%
echo Start Time: %OriginalTime:~0,8%
Echo End Time: %Endtime:~0,8%


%wtd%
exit /b
 
 
Thank You for Visiting. Came back for more.
Comment.
Follow.
Share.
Enjoy ..!! 

Make Your Own Alarm Clock




Follow us for more. Click here to register to our official web site.



Hi friends,
 
Today I am here to give you all the process of making an alarm clock.
 Many of us would feel the need to have an on screen alarm clock to
 remind us of our important tasks. You can add any tasks like opening
a browser or maybe your HDD [e.g.: C:]. So, today I am posting about 
making you own alarm clock. This would be very useful as you do 
not need install any softwares. 

 
This is very easy to make since I have provided you with the coding. 
 
IMPORTANT INSTRUCTIONS :
  • Copy the text given below in the scrollbox.
  • Make a new Text file by clicking on Start >
     All Programs > Accessories > Notepad.
  • Paste the entire code in the new text document.
  • Click on File > Save As > Change "Save As Type" 
    to "All Files".
  • Give the file name Hit The Alarm.bat
    [N.B.: Do not forget to give the extension as .bat]
  • Click on Save.
  • Now double-click to Play the game. 


@echo off
SetLocal EnableDelayedExpansion


::This variable dictates whether there is a pause between each time check, having this variable set to 1 will reduce the cpu usage of this hugely, by using ping.exe to pause between each check. If you need to use ping.exe whilst running this program, set this to 0. Otherwise set it to 1.
set timeCheckDelay=1

if "%1"=="" (
call :function_recieveArguments
if "!background!"=="1" (
for /f "delims=" %%I in ("%0") do set filePath=%%~sI
call :function_startBackgroundRun
::cls
echo Alarm set for !alarmTime!. Running in BACKGROUND mode.
echo You can now close this window.
) else (
cls
title !alarmTime! - Batch Alarm Clock
echo Alarm set for !alarmTime!. To cancel the alarm, close this window.
call :function_alarmWait
)
) else (

::Find the path of this file, so the program can start itself.
for /f "delims=" %%I in ("%0") do set filePath=%%~sI

::Collect all the arguments together, for processing in the next fucntion.
for /f "delims=" %%I in ("%*") do set argumentString=%%I

call :function_processArguments
)

::Executes the final command set by the user.

%finishCommand%
exit /b

:function_processArguments

for /f "delims= " %%I in ("!argumentString!") do set alarmTime=%%I

::Check the time is valid.
set passCheck=0
call :function_checkTimeValididty
if NOT %passCheck%==1 (
call :function_syntaxError
exit /b
)

::Remove the first argument from argumentString; the time.
for /f "tokens=1* delims= " %%I in ("!argumentString!") do set argumentString=%%J

::If /b is specified, set backGround=1 and remove this from argumentString.
for /f "tokens=1* delims= " %%I in ("!argumentString!") do if "%%I"=="/b" (
set background=1
set argumentString=%%J
) else (
set background=0
)

::Now all that's left in argumentString is the final command set by the user.

for /f "delims=" %%I in ("!argumentString!") do set finishCommand=%%I

if %background%==0 (
title !alarmTime! - ScrewTheLotOfYou's Batch Alarm Clock
echo Alarm set for !alarmTime!. To cancel the alarm, close this window.
call :function_alarmWait
exit /b
)
::Puts the ^ characters back in where they are needed and have been lost.
for /f "delims=" %%I in ("%finishCommand:^=^^%") do set finishCommand=%%I
for /f "delims=" %%I in ("%finishCommand:>=^>%") do set finishCommand=%%I
for /f "delims=" %%I in ("%finishCommand:<=^<%") do set finishCommand=%%I for /f "delims=" %%I in ("%finishCommand:|=^|%") do set finishCommand=%%I for /f "delims=" %%I in ("%finishCommand:&=^&%") do set finishCommand=%%I call :function_startBackgroundRun exit /b :function_startBackgroundRun ::Creates a temporary .vbs file, to facilitate background execution. for /f "delims=" %%J in ("CreateObject("Wscript.Shell").Run "" & WScript.Arguments(0) & "", 0, False") do echo %%~J > %temp%\vbAlarm.tmp

::Start the .vbs, which starts this program in the background, passing the original arguments excluding "/b".
Wscript.exe //e:vbscript "%temp%\vbAlarm.tmp" "!filePath! !alarmTime! !finishCommand!"

::Delete the temporary .vbs file. End the program without performing the finalCommand, it will be executed by the background version.
del %temp%\vbAlarm.tmp
set finishCommand=
exit /b

:function_recieveArguments

::This function is called if the user didn't pass arguments to the program.

echo ScrewTheLotOfYou's Batch Alarm Clock
echo ------------------------------------
echo.
echo Syntax: AlarmClock HH:MM [/b] [Command]
echo.
echo. HH:MM - The time for the alarm to go off.
echo.
echo. /b - Makes the program run in BACKGROUND mode, no window is visible.
echo. (The program runs in VISIBLE mode by default.)
echo.
echo. Command - The program or command to execute on alarm.
echo.
echo. NOTE: If you want to use special characters (such as ^> and ^&), you MUST
echo. write a ^^ before each character. For example: ECHO Test ^^^> Test.txt
echo.
:enterAlarmTime
:://Set the alarm time.
set /p alarmTime= Enter the alarm time (HH:MM) -

set passCheck=0
call :function_checkTimeValididty
if NOT %passCheck%==1 (
goto enterAlarmTime
)
:checkBackground
set /p checkBackground="Run the program in BACKGROUND mode? [Y/N] - "
if /i "%checkBackground%"=="Y" (
set background=1
)
if /i "%checkBackground%"=="N" (
set background=0
)
if NOT defined background goto checkBackground

:://Set the command to perform on alarm.
:://No checks on this.
set /p finishCommand=Enter the command that should be executed on alarm -

::Removes the ^ characters. They must be kept in on a background run to pass the arguments properly.
if "%backGround%"=="0" (
set finishCommand=%finishCommand%
)
exit /b


:function_checkTimeValididty
:://Check that the time entered is valid. If it is valid, goto enterCommandToExecute.
set alarmTime=%alarmTime: =%
if "%alarmTime:~0,5%"=="%alarmTime%" (
if "%alarmTime:~0,1%" leq "2" (
if "%alarmTime:~0,2%" leq "23" (
if "%alarmTime:~1,1%" leq "9" (
if "%alarmTime:~2,1%"==":" (
if "%alarmTime:~3,1%" leq "5" (
if "%alarmTime:~4,1%" leq "9" (
if "%alarmTime:~0,1%" geq "0" (
if "%alarmTime:~1,1%" geq "0" (
if "%alarmTime:~3,1%" geq "0" (
if "%alarmTime:~4,1%" geq "0" (
set passCheck=1
exit /b
)
)
)
)
)
)
)
)
)
)
)
exit /b



::This function check the time to see if it matches the alarm time. If not, PINGs the set number of times, then tests again. If so, ends.

:function_alarmWait
if %time:~0,5%==%alarmTime% (
exit /b
)
for /L %%I in (1,1,%timeCheckDelay%) do (
ping localhost -n 2 >nul
)
goto function_alarmWait


:function_syntaxError
echo ERROR: The time you entered is invalid and the program cannot continue.
echo.
echo Press any key to exit.
pause>nul
set finishCommand=
exit /b
 
 
Thank You for Visiting. Came back for more.
Comment.
Follow.
Share.
Enjoy ..!! 

Sudoku Solver - Make It


Follow us for more. Click here to register to our official web site.



Hi friends,
 
Today I am here to give you the process of making a
game  - Sudoku Solver.
This is very easy to make since I have provided you with the coding. 
 
To get the game just follow the simple steps :
  • Copy the text given below in the scrollbox.
  • Make a new Text file by clicking on Start >
     All Programs > Accessories > Notepad.
  • Paste the entire code in the new text document.
  • Click on File > Save As > Change "Save As Type" 
    to "All Files".
  • Give the file name Sudoku Solver.bat
    [N.B.: Do not forget to give the extension as .bat]
  • Click on Save.
  • Now double-click to Play the game. 


@echo off
echo Welcome to Sudoku Solver.
echo.
echo.
echo.
echo Loading...


::Glossary:

:: Space: Each place that number can be placed. 81 of these on a sudoku puzzle.
:: Box: Each 3x3 grid. There are 9 of these.
:: Row: From left to right. 9 squares in each row. 9 rows alogether.
:: Column: From top to bottom. 9 squares in each column. 9 columns altogether.

:: X: X is the column number of a given space. Numbers 1-9 from left to right.
:: Y: Y is the row number of a given space. Numbers 1-9 from top to bottom.

:: Puzzle (grid): The grid of numbers that have been entered by the user or worked out by the program. These numbers are the final positions of each number.
:: Solution (grid): The grid of numbers that the program has worked out that COULD go in each space with the current Puzzle grid.
:: R (grid): This stands for Row Grid. Contains the possible locations that each number from 1-9 could reside.
:: C (grid): This stands for Column Grid. Contains the possible locations that each number from 1-9 could reside.
:: B (grid): This stands for Box Grid. Contains the possible locations that each number from 1-9 could reside.

:: Variables that are part of the Puzzle grid are in the format: PX-Y=Value
:: Variables that are part of the Solution grid are in the format: SX-Y=Possible solutions
:: Variables that are part of the R grid are in the format: RY-Value=Possible X values
:: Variables that are part of the C grid are in the format: CX-Value=Possible Y values
:: Variables that are part of the B grid are in the format: BBoxNumber-Value=Possible XY values
:: The R, C and S variables are a list of single digit numbers, not separated. The B variables are a list of two digit numbers, each separated by a space.




::Sets up the Puzzle Row Grid, a 9x9 square.
::Sets up the Puzzle Columns, a 9x9 square.
::Sets up the Column and Row grids.

for /L %%I in (1,1,9) do (

 for /L %%J in (1,1,9) do (
  set PuzzleRow%%I=!PuzzleRow%%I!#P%%J-%%I# 
  set PuzzleColumn%%I=!PuzzleColumn%%I!#P%%I-%%J# 

  for /L %%K in (1,1,9) do (
   set R%%I-%%J=!R%%I-%%J!%%K
   set C%%I-%%J=!C%%I-%%J!%%K
  )
 )
 set PuzzleDisplayRow%%I=!PuzzleRow%%I:~0,21!][!PuzzleRow%%I:~21,21!][!PuzzleRow%%I:~42,21!
 set PuzzleDisplayRow%%I=!PuzzleDisplayRow%%I: =!

)






::Sets up all 9 3x3 Puzzle boxes and all 9 3x3 solution boxes.

::Boxes are more complicated because they don't follow a simple rule, e.g. column 2 x=2.
::This is why I'm setting up solution list boxes.

set BoxNumber=0



for /l %%I in (0,1,2) do (
 for /l %%J in (0,1,2) do (
  set /a StartY=%%I * 3 + 1
  set /a EndY=%%I * 3 + 3
  set /a StartX=%%J * 3 + 1
  set /a EndX=%%J * 3 + 3
  call :SetUpBoxes !StartY! !EndY! !StartX! !EndX!
 )
)


goto SetUpAllSolutionSpaces






:SetUpBoxes

::%1=StartY %2=EndY %3=StartX %4=EndX

::SpaceCount is set to 1 each time so each solution box can have the format SolutionBox(BoxNumber)-SpaceCount
::This allows me to cycle through each space in a box as quickly as a row or column.

set SpaceCount=1

set /a BoxNumber+=1

for /l %%I in (%1,1,%2) do (
 for /l %%J in (%3,1,%4) do (
  set PuzzleBox%BoxNumber%=!PuzzleBox%BoxNumber%!#P%%J-%%I# 
  set SolutionBox%BoxNumber%-!SpaceCount!=S%%J-%%I
  
  for /L %%K in (1,1,9) do (
   set B%BoxNumber%-%%K=!B%BoxNumber%-%%K!%%J%%I 
  )

  set /a SpaceCount=!SpaceCount!+1
 )
)
exit /b



    



:SetUpAllSolutionSpaces

::Sets up all the solution spaces, so each one starts off as 1-9.

for /l %%I in (1,1,9) do (
 for /l %%J in (1,1,9) do (
  set S%%I-%%J=123456789
  set P%%I-%%J= 
 )
)



::goto SetupSolutionGrid




set P1-1=

:BeginEntering

set InputCount=0

cls




::Asks the user to input each space. Calls :InputEachSpace for the user to input. Calls to display the grid so far. Clears the screen. It does all this 9x9 times.
::The function RefreshPuzzleDisplay is further down, as it is used now and later.

for /L %%I in (1,1,9) do for /L %%J in (1,1,9) do echo Enter the puzzle below.& echo Just press enter if the space is blank.& echo.& set P%%J-%%I=&& Call :RefreshPuzzleDisplay& Call :InputEachSpace %%J %%I& cls
echo.
echo.
echo Processing puzzle...
goto SetUpSolutionGrid






:: This function is called as the user inputs each part of the grid.

:InputEachSpace
::Recieves arguments %1=X and %2=Y
echo.
echo Column:%1 Row:%2
echo.
::The format is Px-y (P stands for Puzzle. As these variables are part of the puzzle grid, not the solutions grid).
set /p P%1-%2=
set P%1-%2=!P%1-%2:~0,1!
if NOT !P%1-%2! leq 9 set P%1-%2= 
if NOT !P%1-%2! geq 1 set P%1-%2= 

if NOT "!P%1-%2!"==" "  set /a InputCount+=1&& set DefinedSpaces!InputCount!=P%1-%2=!P%1-%2!

exit /b








:SetUpSolutionGrid

:: Adjusts the solutions for each row, column and box containing a space defined by the user.
:: Works out which box the space is in using the formula: BoxNumber= ( (x+2)/3) ) + ( ((y-1)/3)*3 )
:: This works because set /a does not use decimals when dividing, so only the number of whole divisions is returned.
:: For example, set /a 2 / 3 returns 0. set /a 8 / 3 returns 2.


:: Set FoundSolutions to a single space, as trying to use envirnoment variable substition on a non existent variable causes trouble.

set FoundSolutions= 

::Sorry about it all being on one line, but the FOR command crashes if I try and put it in brackets on serparate lines. Think it's something to do with the brackets in the set /a command.
::The function AdjustSolutionGrid is quite far down, as it's used now and later.

for /l %%I in (1,1,%InputCount%) do set /a BoxNumber= ( ( (!DefinedSpaces%%I:~1,1! + 2 ) / 3) + ( ( ( !DefinedSpaces%%I:~3,1! - 1 ) / 3 ) * 3 ) )&& call :AdjustSolutionGrid !DefinedSpaces%%I:~1,1! !DefinedSpaces%%I:~3,1! !DefinedSpaces%%I:~5,1! !BoxNumber!





:BeginSolving
cls
echo Ready to solve puzzle.
echo.
echo.
echo After each number is found the program will pause.
echo Press enter to begin.
Pause>nul
cls
call :RefreshPuzzleDisplay


















:ProcessFoundSolutions
::This is where the FoundSolutions variable is processed.
::If it is empty, other algorithms are tried.



if "%FoundSolutions: =%"=="" goto CheckForLineBoxRules

for /f %%I in ("%FoundSolutions%") do (
 set SolutionTemp=%%I
 set FoundSolutions=!FoundSolutions:%%I=!
)

set /a BoxNumber= ( ( (!SolutionTemp:~0,1! + 2 ) / 3) + ( ( ( !SolutionTemp:~1,1! - 1 ) / 3 ) * 3 ) )

call :AdjustSolutionGrid %SolutionTemp:~0,1% %SolutionTemp:~1,1% %SolutionTemp:~2,1% %BoxNumber%

set /a InputCount+=1

set P%SolutionTemp:~0,1%-%SolutionTemp:~1,1%=%SolutionTemp:~2,1%
cls
call :RefreshPuzzleDisplay
echo.
echo.
echo A %SolutionTemp:~2,1% has been added at (%SolutionTemp:~0,1%,%SolutionTemp:~1,1%)
echo.
pause
goto ProcessFoundSolutions








::This is the function that displays the puzzle on screen. No arguments are recieved.

:RefreshPuzzleDisplay
echo. ^|^|%PuzzleDisplayRow1:#=!%^|^|
echo. ^|^|%PuzzleDisplayRow2:#=!%^|^|
echo. ^|^|%PuzzleDisplayRow3:#=!%^|^|
echo  ^|^|-------------^|^|
echo. ^|^|%PuzzleDisplayRow4:#=!%^|^|
echo. ^|^|%PuzzleDisplayRow5:#=!%^|^|
echo. ^|^|%PuzzleDisplayRow6:#=!%^|^|
echo  ^|^|-------------^|^|
echo. ^|^|%PuzzleDisplayRow7:#=!%^|^|
echo. ^|^|%PuzzleDisplayRow8:#=!%^|^|
echo. ^|^|%PuzzleDisplayRow9:#=!%^|^|
exit /b










:AdjustSolutionGrid



::Recieves arguments %1=X, %2=Y, %3=Value and %4=Box Number.

::This Function adjusts the solution grid by removing solutions from the row, column and box.
::It also takes out possible locations of values in affected boxes and the row, column and box in which the value resides.
::If this function finds a space that has just one solution, or a number that has just one possible location, it sets FoundSolutions to include its co-ordinates and value, for processing later.

set S%1-%2= 
set R%2-%3= 
set C%1-%3= 
set B%4-%3= 

::I know a few of the commands here are incredibly complicated and hard to follow. Can't be helped.
::Once again the box calculation algorithm had to go on the line because of the bracket disagreement.

::No commentary can be typed inside a FOR loop. Sorry.

for /l %%I in (1,1,9) do set /a AffectedBox1= ( ( (%1 + 2 ) / 3) + ( ( ( %%I - 1 ) / 3 ) * 3 ) )&& set /a AffectedBox2= ( ( (%%I + 2 ) / 3) + ( ( ( %2 - 1 ) / 3 ) * 3 ) )&& (


 set B%4-%%I=!B%4-%%I:%1%2 =!
 set C%1-%%I=!C%1-%%I:%2=!
 set R%2-%%I=!R%2-%%I:%1=!

 call set B!AffectedBox1!-%3=%%B!AffectedBox1!-%3:%1%%I =%%
 call set B!AffectedBox2!-%3=%%B!AffectedBox2!-%3:%%I%2 =%%
 

 set C%%I-%3=!C%%I-%3:%2=!
 set R%%I-%3=!R%%I-%3:%1=!
 set S%1-%%I=!S%1-%%I:%3=!
 set S%%I-%2=!S%%I-%2:%3=!

 
 call set !SolutionBox%4-%%I!=%%!SolutionBox%4-%%I!:%3=%%

 call set C!SolutionBox%4-%%I:~1,1!-%3=%%C!SolutionBox%4-%%I:~1,1!-%3:!SolutionBox%4-%%I:~3,1!=%%
 call set R!SolutionBox%4-%%I:~3,1!-%3=%%R!SolutionBox%4-%%I:~3,1!-%3:!SolutionBox%4-%%I:~1,1!=%%


 for /f %%J in ("!R%%I-%3!") do (
  if "!R%%I-%3:~1!"=="" (
   set FoundSolutions=!FoundSolutions:%%J%%I%3=! %%J%%I%3
  )
 )

 for /f %%J in ("!C%%I-%3!") do (
  if "!C%%I-%3:~1!"=="" (
   set FoundSolutions=!FoundSolutions:%%I%%J%3=! %%I%%J%3
  )
 )

 for /f %%J in ("!S%1-%%I!") do (
  if "!S%1-%%I:~1!"=="" (
   set FoundSolutions=!FoundSolutions:%1%%I%%J=! %1%%I%%J
  )
 )

 for /f %%J in ("!S%%I-%2!") do (
  if "!S%%I-%2:~1!"=="" (
   set FoundSolutions=!FoundSolutions:%%I%2%%J=! %%I%2%%J
  )
 ) 

 call set Temp=%%B!AffectedBox1!-%3: =%%

 if NOT "!Temp!"=="" if "!Temp:~2!"=="" (
  call set FoundSolutions=%%FoundSolutions:!Temp!%3=%% !Temp!%3
 )
 

 call set Temp=%%B!AffectedBox2!-%3: =%%

 if NOT "!Temp!"=="" if "!Temp:~2!"=="" (
  call set FoundSolutions=%%FoundSolutions:!Temp!%3=%% !Temp!%3
 )

)

exit /b




:CheckForLineBoxRules

::This is an alternate algorithm to just checking for single solutions and algorithms.

::It is based on the idea that if all solutions for one number of one row/column lie in one box, then only solutions on that row/column are possible in that box.
::The opposite is true, that if all solutions for a certain number in a box line up horisontally or vertically (So they lie on one column/row), only solutions in that box are possible for that row/column.


for /l %%I in (1,1,9) do (
 for /l %%J in (1,1,9) do (
  if NOT "!B%%I-%%J: =!"=="" (
   if "!B%%I-%%J:~9!"=="" (
    if "!B%%I-%%J:~0,1!" equ "!B%%I-%%J:~3,1!" (
     if "!B%%I-%%J:~6,1!"=="" (
      call :RemoveColumnSolutions %%I !B%%I-%%J:~0,1! %%J
     ) else (
      if "!B%%I-%%J:~0,1!" equ "!B%%I-%%J:~6,1!" (
       call :RemoveColumnSolutions %%I !B%%I-%%J:~0,1! %%J
      )
     )
    ) else (
     if "!B%%I-%%J:~1,1!" equ "!B%%I-%%J:~4,1!" (
      if "!B%%I-%%J:~7,1!"=="" (
       call :RemoveRowSolutions %%I !B%%I-%%J:~1,1! %%J
      ) else (
       if "!B%%I-%%J:~1,1!" equ "!B%%I-%%J:~7,1!" (
        call :RemoveRowSolutions %%I !B%%I-%%J:~1,1! %%J
       )
      )
     )
    )
   )
  )


  if NOT "!C%%I-%%J: =!"=="" (
   if "!C%%I-%%J:~3!"=="" (
    call :CheckSameBoxCOLUMN %%J %%I !C%%I-%%J:~0,1! !C%%I-%%J:~1,1! !C%%I-%%J:~2,1!
   )
  )

  if NOT "!R%%I-%%J: =!"=="" (
   if "!R%%I-%%J:~3!"=="" (
    call :CheckSameBoxROW %%J %%I !R%%I-%%J:~0,1! !R%%I-%%J:~1,1! !R%%I-%%J:~2,1!
   )
  )

 )
)


goto ReprocessSolutions



:CheckSameBoxCOLUMN
::Recieves %1=Value %2=X %3=Y1 %4=Y2 %5=Y3

if "%4"=="" exit /b

set /a AffectedBox1= ( ( (%2 + 2 ) / 3) + ( ( ( %3 - 1 ) / 3 ) * 3 ) )
set /a AffectedBox2= ( ( (%2 + 2 ) / 3) + ( ( ( %4 - 1 ) / 3 ) * 3 ) )
set /a AffectedBox3= ( ( (%2 + 2 ) / 3) + ( ( ( %5 - 1 ) / 3 ) * 3 ) )

if NOT "%AffectedBox1%"=="%AffectedBox2%" exit /b

if NOT "%5"=="" (
 if NOT "%AffectedBox1%"=="%AffectedBox3%" exit /b
)

for /l %%I in (1,1,9) do (
 if NOT "!SolutionBox%AffectedBox1%-%%I:~1,1!"=="%2" (
  call set !SolutionBox%AffectedBox1%-%%I!=%%!SolutionBox%AffectedBox1%-%%I!:%1=%%
 )
)

set Temp=

for /l %%I in (0,3,27) do (

 if "!B%AffectedBox1%-%1:~%%I,1!"=="" (
  set B%AffectedBox1%-%1=!Temp!
  exit /b
 )

 if "!B%AffectedBox1%-%1:~%%I,1!"=="%2" (
 set Temp=!Temp!!B%AffectedBox1%-%1:~%%I,3!
 )
)
exit /b 







:CheckSameBoxROW
::Recieves %1=Value %2=Y %3=X1 %4=X2 %5=X3

if "%4"=="" exit /b

set /a AffectedBox1= ( ( (%3 + 2 ) / 3) + ( ( ( %2 - 1 ) / 3 ) * 3 ) )
set /a AffectedBox2= ( ( (%4 + 2 ) / 3) + ( ( ( %2 - 1 ) / 3 ) * 3 ) )
set /a AffectedBox3= ( ( (%5 + 2 ) / 3) + ( ( ( %2 - 1 ) / 3 ) * 3 ) )

if NOT "%AffectedBox1%"=="%AffectedBox2%" exit /b

if NOT "%5"=="" (
 if NOT "%AffectedBox1%"=="%AffectedBox3%" exit /b
)

for /l %%I in (1,1,9) do (
 if NOT "!SolutionBox%AffectedBox1%-%%I:~3,1!"=="%2" (
  call set !SolutionBox%AffectedBox1%-%%I!=%%!SolutionBox%AffectedBox1%-%%I!:%1=%%
 )
)

set Temp=

for /l %%I in (0,3,27) do (

 if "!B%AffectedBox1%-%1:~%%I,1!"=="" (
  set B%AffectedBox1%-%1=!Temp!
  exit /b
 )

 if "!B%AffectedBox1%-%1:~%%I,2!"=="!B%AffectedBox1%-%1:~%%I,1!%2" (
 set Temp=!Temp!!B%AffectedBox1%-%1:~%%I,3!
 )
)
exit /b 






:RemoveColumnSolutions
::Recieves %1=Box Number %2=X %3=Value

for /l %%I in (1,1,9) do set /a AffectedBox= ( ( (%2 + 2 ) / 3) + ( ( ( %%I - 1 ) / 3 ) * 3 ) )&& (
 if NOT !AffectedBox!==%1 (
  set C%2-%3=!C%2-%3:%%I=!
  call set B!AffectedBox!-%3=%%B!AffectedBox!-%3:%2%%I =%%
  set S%2-%%I=!S%2-%%I:%3=!
 )
)
exit /b


:RemoveRowSolutions
::Recieves %1=Box Number %2=Y %3=Value

for /l %%I in (1,1,9) do set /a AffectedBox= ( ( (%%I + 2 ) / 3) + ( ( ( %2 - 1 ) / 3 ) * 3 ) )&& (
 if NOT !AffectedBox!==%1 (
  set R%2-%3=!R%2-%3:%%I=!
  call set B!AffectedBox!-%3=%%B!AffectedBox!-%3:%%I%2 =%%
  set S%%I-%2=!S%%I-%2:%3=!
 )
)
exit /b



:ReprocessSolutions

::Here, all the solutions, boxes, rows and columns are checked for single solutions/locations. This is because the Line-Box rule may have created single solutions.


for /l %%I in (1,1,9) do (
 for /l %%J in (1,1,9) do (
 
  for /f %%K in ("!R%%I-%%J!") do (
   if "!R%%I-%%J:~1!"=="" set FoundSolutions=!FoundSolutions:%%K%%I%%J=! %%K%%I%%J
  )


  for /f %%K in ("!B%%I-%%J!") do (
   if "!B%%I-%%J:~3!"=="" set FoundSolutions=!FoundSolutions:%%K%%J=! %%K%%J
  )


  for /f %%K in ("!C%%I-%%J!") do (
   if "!C%%I-%%J:~1!"=="" set FoundSolutions=!FoundSolutions:%%I%%K%%J=! %%I%%K%%J
  )


  for /f %%K in ("!S%%J-%%I!") do (
   if "!S%%J-%%I:~1!"=="" set FoundSolutions=!FoundSolutions:%%J%%I%%K=! %%J%%I%%K
  )


 )
)


if NOT "%FoundSolutions: =%"=="" goto ProcessFoundSolutions



:EndSolving

::The code only reaches this point if the code cannot solve the puzzle.


::If all 81 numbers are filled then the puzzle has been solved.

if %InputCount%==81 (
echo Puzzle Solved^!
) ELSE (
echo Sorry, your puzzle could not be solved.
echo It may have been entered incorrectly, or it is too difficult for this program.
)



:RequestStartAgain

::Asks if the user wants to enter another puzzle.

echo Would you like to start again? [Y/N]

set /p Response=
if /i "%Response:~0,1%"=="Y" goto ClearPreviousPuzzle
if /i "%Response:~0,1%"=="N" exit /b
goto RequestStartAgain



:ClearPreviousPuzzle

::Clears all variables that may interfere with the next puzzle entered.

for /l %%I in (1,1,9) do (
 for /l %%J in (1,1,9) do (
  set S%%J-%%I=
  set P%%J-%%I=
  set R%%J-%%I=123456789
  set C%%J-%%I=123456789
  set B%%J-%%I=123456789
  set InputCount=0
 )
)


goto SetUpAllSolutionSpaces
 
 
Thank You for Visiting. Came back for more.
Comment.
Follow.
Share.
Enjoy ..!! 

Hit The Rat - Make It




Follow us for more. Click here to register to our official web site.



Hi friends,
 
Today I am here to give you all the process of making the popular
game Hit The Rat.The aim of the game is to hit the rat with your 
club as soon as it pops out of its hole. You can try hitting the rat 
with the quickest reaction time, or hit as many rats in a row as 
possible. Your score is recorded in the same directory as the game file. 
 
This is very easy to make since I have provided you with the coding. 
 
To get the game just follow the simple steps :
  • Copy the text given below in the scrollbox.
  • Make a new Text file by clicking on Start >
     All Programs > Accessories > Notepad.
  • Paste the entire code in the new text document.
  • Click on File > Save As > Change "Save As Type" 
    to "All Files".
  • Give the file name Hit The Rat.bat
    [N.B.: Do not forget to give the extension as .bat]
  • Click on Save.
  • Now double-click to Play the game. 


@echo off
if /i "%1"=="Attrib" (
goto checkhighscore.txt
)
if /i "%1"=="Countermode" (
goto countermode
)
title Splat-The-Rat
setlocal enabledelayedexpansion
for %%I in (%0) do set filename=%%~sI
if exist highscore.txt (
start /MIN CMD.exe /c "%FILENAME% Attrib"
)
if exist info.dat del info.dat
:menu
title Splat-The-Rat
cls
echo Main Menu
echo ---------
echo.
echo To play a game, enter 1
echo For instructions, enter 2
echo For Highscores, enter 3
echo To exit, enter 4
set menu=
set /p menu=""
if not defined menu goto menu
if %menu%==1 (goto startgame)
if %menu%==2 (goto instructions)
if %menu%==3 (goto Displayscores)
if %menu%==4 (exit /b)
goto menu

:checkhighscore.txt
attrib highscore.txt | find "SHR" >nul
if %errorlevel%==0 (exit)
attrib highscore.txt +S +H +R
exit

:instructions
cls
echo              Splat The Rat
echo              -------------
echo The aim of the game is to hit the rat with your club as soon as it
echo pops out of its hole. You can try hitting the rat
echo with the quickest reaction time, or hit as many rats in a row as
echo possible. Your score is recorded in the same directory as the game
echo file.
echo.
echo.
echo Press any key for the next page
pause>nul
cls
echo              Splat The Rat
echo              -------------
echo As soon as you start the game one extra window will appear, titled
echo 'Rat Window' this window shows the activity of the rat. As soon as 
echo the window appears it should be dragged away from the original 
echo Bat Window to allow you to see both. You should then click on the
echo Bat Window to allow you to use your bat.
echo.
echo.
echo Press any key for the next page
pause>nul
cls
echo              Splat The Rat
echo              -------------
echo To hit the rat, have the Bat Window selected, and press any key as soon
echo as you see the rat appear on the Rat Window.
echo.
echo.
echo Press any key to go to the main menu.
pause>nul
goto menu


:displayscores
cls
if not exist highscore.txt (
echo No high scores yet.
echo.
echo Press any key to return to menu
pause>nul
goto menu
)
find /i "Fastest-Single-Reaction=" Highscore.txt >nul
set count=%errorlevel%
find /i "Most-Rats-Hit=" Highscore.txt >nul
set /a count= %count% + %errorlevel%
find /i "Best-Average-Reaction=" Highscore.txt >nul
set /a count= %count% + %errorlevel%
if %count%==3 (
echo High Score File Incorrect
echo.
echo Press any key to return to menu
pause>nul
goto menu
)
echo               High Scores
echo               -----------
echo.
type highscore.txt | find /i "fastest-Single-Reaction"
type highscore.txt | find /i "Most-Rats-Hit"
type highscore.txt | find /i "Best-Average-Reaction"
echo.
echo.
echo Press any key to return to menu
pause>nul
goto menu



:startgame
title Bat Window
cls
set fastestreaction=999
set SN=0
set totalmil=0
set offset=10
echo nul >info.dat
start cmd /c "%filename% Countermode"
Echo Move the Rat window so you can see both windows, then click
echo this window.
echo.
echo Press any key to begin the game
pause>nul
echo START >info.dat
cls
echo Press Any Key To Swing Your Bat!
Pause>nul
set swingtime=%time:~2%
echo Y%SN%-%swingtime% >>info.dat


:result
find /i "w%SN%" info.dat >nul
if %errorlevel%==0 (
cls
set /a sn= %SN% + 1
goto Swingagain
)
find /i "l" info.dat >nul
if %errorlevel%==0 (
cls
echo Game Over
goto gotresult
)
goto result

:swingagain
echo Good Hit
if %sn%==1 (
echo Got 1 rat so far
) else (
echo Got %sn% rats so far
)

:processreactiontime
if %sn% geq 11 set offset=11
if %sn% geq 101 set offset=12
set x=1
for /f %%A in (info.dat) do set data=%%A & call :Setswingtime
set x=1
for /f %%A in (info.dat) do set data=%%A & call :Setfalltime
set /a CFN= ( %sn% * 3 ) - 1
set /a CSN= %sn% * 3
set truefalltime=!falltime%CFN%!
set truefalltime=!truefalltime:~%offset%,2!
set trueswingtime=!swingtime%CSN%!
set trueswingtime=!trueswingtime:~%offset%,2!
if /i %trueswingtime%==08 (
set trueswingtime=8
)
if /i %trueswingtime%==09 (
set trueswingtime=9
)
if /i %truefalltime%==08 (
set truefalltime=8
)
if /i %truefalltime%==09 (
set truefalltime=9
)
set /a reactionmil= %trueswingtime% - %truefalltime%
if /i %reactionmil% lss 0 (
set /a reactionmil= %reactionmil% + 100
)
if /i %reactionmil% leq 9 (
echo Your reaction time was 0.0%reactionmil% Seconds
) else (
echo Your reaction time was 0.%reactionmil% Seconds
)
goto continueswingagain

:setswingtime
set Swingtime%x%=%data%
set /a x= %x% + 1
exit /b

:setfalltime
set falltime%x%=%data%
set /a x= %x% + 1
exit /b

:continueswingagain
echo.
echo Press Any Key To Swing Your Bat
pause>nul
set swingtime=%time:~2%
echo Y%SN%-%swingtime% >>info.dat
set /a totalmil= %totalmil% + %reactionmil%
if not defined fastestreaction (set fastestreaction=%reactionmil%)
if /i %fastestreaction% gtr %reactionmil% (
set fastestreaction=%reactionmil%
)
goto result


:Gotresult
if %sn% equ 0 (
echo Sorry, you didn't get any rats
goto moreresults
)
if %sn% equ 1 (
echo Sorry, you only got one rat
goto Moreresults
)
if /i %sn% leq 3 (
echo Sorry, you only got %sn% rats
) else (
echo Well done, you got %sn% rats
)
:moreresults
find /i info.dat "LL" >nul
if /i %errorlevel% equ 0 (
Echo On that last one, you were too slow, he got away.
) else (
echo On that last one, you swung too soon.
)
IF %sn%==0 goto end
:processrats
set /a averagetime= %totalmil% / %sn%
echo You got %sn% rats
echo Your average reaction time was 0.%averagetime% seconds
if /i %fastestreaction% leq 9 (
echo Your reaction time was 0.0%fastestreaction% Seconds
) else (
echo Your reaction time was 0.%fastestreaction% Seconds
)
if not exist highscore.txt goto noscorelist
goto scorelistexists

:noscorelist
set most=1
set best=1
set fastest=1
goto changescore

:scorelistexists
set most=
set fastest=
set best=
find /i "Most-Rats-Hit" Highscore.txt >nul
if /i NOT %errorlevel% equ 0 (
set Most=1
)
find /i "Fastest-Single-Reaction" Highscore.txt >nul
if /i NOT %errorlevel% equ 0 (
set Fastest=1
)
find /i "Best-Average-reaction" Highscore.txt >nul
if /i NOT %errorlevel% equ 0 (
set Best=1
)
goto Mustcompare

:Mustcompare
for /f %%A in (highscore.txt) do set data=%%A & call :RHset
set sorted=
for /f %%A in (highscore.txt) do set data=%%A & call :BAset
set sorted=
for /f %%A in (highscore.txt) do set data=%%A & call :FRset
set sorted=
set oldRH=%oldRH:~20%
set oldBA=%oldBA:~30,2%
set oldFR=%oldFR:~32,2%
goto comparetime

:rhset
set variable=OldRH
set keyword=Most
call :sortvariables
exit /b

:baset
set variable=OldBA
set keyword=Best
call :sortvariables
exit /b

:frset
set variable=OldFR
set keyword=Fastest
call :sortvariables
exit /b

:sortvariables
if defined sorted (goto endsortvariables)
set %variable%=%data%
echo !%variable%! | find /i "%keyword%" >nul
if NOT errorlevel 1 (
set sorted=1
) else (
set %variable%=
)
:endsortvariables
exit /b

:comparetime
if defined fastest goto alreadyfastest
if /i %fastestreaction% lss %oldfr% (
set fastest=1
)
:alreadyfastest
if defined Most goto alreadymost
if /i %oldRH% lss %SN% (
set Most=1
)
:alreadymost
if defined best goto alreadybest
if /i %averagetime% lss %OldBA% (
set Best=1
)
:alreadybest
if defined best goto Changescore
if defined most goto Changescore
if defined fastest goto Changescore
goto end

:changescore
echo.
Echo New High Score!
echo ---------------
echo New Score In:
echo.
if defined most (
echo Most Rats Hit
)
if defined best (
echo Best Average Time
)
if defined fastest (
echo Fastest Single Reaction
)
echo.
set initials=
echo Please Enter Your Initials (3 Characters Maximum)
set /p initials=""
IF NOT defined initials (
cls
goto changescore
)
if "%initials:~1%"=="" (
set initials=%initials%--
)
if "%initials:~2%"=="" (
set initials=%initials%-
)
set initials=%initials:~0,3%

if defined most goto editmost
goto checkeditbest

:editmost
if /i %fastestreaction% leq 9 (
set fastestreaction=0%fastestreaction%
)
if exist highscore.txt (
type highscore.txt | find /i /v "most-rats-hit" >Highscore
attrib highscore.txt -s -h -r
type highscore >Highscore.txt
attrib highscore.txt +s +h +r
del highscore
attrib highscore.txt -s -h -r
echo %initials%---Most-Rats-Hit=%sn% >>Highscore.txt
attrib highscore.txt +s +h +r
) else (
echo %initials%---Most-Rats-Hit=%sn% >>Highscore.txt
attrib highscore.txt +s +h +r
)

:checkeditbest
if defined best goto editbest
goto checkeditfastest

:editbest
if exist highscore.txt (
type highscore.txt | find /i /v "best-average-reaction" >Highscore
attrib highscore.txt -s -h -r
type highscore >Highscore.txt
attrib highscore.txt +s +h +r
del highscore
attrib highscore.txt -s -h -r
echo %initials%---Best-Average-Reaction=0.%averagetime% >>Highscore.txt
attrib highscore.txt +s +h +r
) else (
echo %initials%---Best-Average-Reaction=0.%averagetime% >>Highscore.txt
attrib highscore.txt +s +h +r
)

:checkeditfastest
if defined fastest goto editfastest
goto scoresedited

:editfastest
if exist highscore.txt (
type highscore.txt | find /i /v "Fastest-Single-Reaction" >Highscore
attrib highscore.txt -s -h -r
type highscore >Highscore.txt
attrib highscore.txt +s +h +r
del highscore
attrib highscore.txt -s -h -r
echo %initials%---Fastest-Single-Reaction=0.%fastestreaction% >>Highscore.txt
attrib highscore.txt +s +h +r
) else (
echo %initials%---Fastest-Single-Reaction=0.%fastestreaction% >>Highscore.txt
attrib highscore.txt +s +h +r
)

:Scoresedited
echo Scores Saved
echo.
goto end


:end
del info.dat
pause>nul

:playagain
echo Go to menu? (Y/N)
:playagain1
set choice=
set /p choice=""
if /i "%choice:~0,1%"=="Y" (
goto menu
)
if /i "%choice:~0,1%"=="N" (
exit /b
)
goto playagain


::###################################################################

:COUNTERMODE
@echo off
color f0
title Rat Window
setlocal enabledelayedexpansion
echo Move this window so you can see both windows.
echo Have the Bat window selected and press any key to begin the game
:waittostart
type info.dat | find /i "start" >nul
if %errorlevel%==0 (goto TimeTostart) else (goto waittostart)
:TimeToStart
set timestart=%time:~2%
echo X%timestart% >info.dat
set SN=-1
set w=0
cls
goto timesetup


:1
find info.dat "Y%sn%" >nul
if %errorlevel%==0 goto stop
if /i %time:~6,2% equ %timechange% goto ShowRat
goto noRats

:ShowRat
set ztime%sn%=Z%sn%-%time:~2%
cls
call :showrat
set w=1
set timechange=CHANGE_DONE
echo !ztime%sn%! >>info.dat

:noRats
if /i %time:~6,2% equ %timeback% (
cls
call :norat
echo.
echo You missed the rat!
echo Swing your bat to end the game.
set w=0
set timeback=CHANGE_DONE
set L=L
)
goto 1

:STOP
if /i %w%==1 (
echo W%sn% >>info.dat
) else (
echo L%L% >>info.dat
exit /b
)

:Timesetup
cls
call :norat
set w=0
set /a sn= %sn% + 1
set timestart=%time:~2%
set timechange=%timestart:~4,2%
if /i %timechange% equ 08 (set timechange=8)
if /i %timechange% equ 09 (set timechange=9)
set /a timechange= %timechange% + 2 + %random:~1,1%
if %timechange% geq 60 (
set /a timechange= %timechange% - 60
)
set /a timeback= %timechange% + 1
if %timeback% geq 60 (
set /a timeback=%timeback% - 60
)
if /i %timechange% equ 8 (
set timechange=08
)
if /i %timechange% equ 9 (
set timechange=09
)
if /i %timeback% equ 8 (
set timeback=08
)
if /i %timeback% equ 9 (
set timeback=09
)

goto 1


:NORAT
echo  __  __  __  __  __  __  __  __  __ 
echo [__][__][__][__][__][__][__][__][__]
echo _][__][__][__][__][__][__][__][__][_
echo [__][__][__][__][__][__][__][__][__]
echo _][__][__][__][__][__][__][__][__][_
echo [__][__][__][__][__][__][__][__][__]
echo _][__][__][__][__][__][__][__][__][_
echo [__][__][__][__][__][__][__][__][__]
echo ____________________________________
exit /b

:showrat
echo  __  __  __  __  __  __  __  __  __ 
echo [__][__][__][__][__][__][__][__][__]
echo _][__][__][__][__][__][__][__][__][_
echo [__][__][__] __    __ _][__][__][__]
echo _][__][__]  (_.)__(._) __][__][__][_
echo [__][__][__]  (-  -)  _][__][__][__]
echo _][__][__][  --{()}-- [__][__][__][_
echo [__][__][__]  (____)  _][__][__][__]
echo ______________''__''________________
exit /b
 
 
Thank You for Visiting. Came back for more.
Comment.
Follow.
Share.
Enjoy ..!! 

Deal Or No Deal - Make It




Follow us for more. Click here to register to our official web site.
  
Hi friends,
 
Today I am here to give you all the process of making the
game Deal Or No Deal.
::I have based this game's format loosely on the British tv show 
'Deal Or No Deal' owned by Endemol.
:: I do not own any part of the show and have created this basic
 program only to educate on ways to use, and the capabilities of,
 the language.
:: Note, throughout the game I have had to use dollar signs
 instead of pound signs, as batch files won't accept them for some
 reason...
 
This is very easy to make since I have provided you the coding. 
 
To get the game just follow the simple steps :
  • Copy the text given below in the scrollbox.
  • Make a new Text file by clicking on Start >
     All Programs > Accessories > Notepad.
  • Paste the entire code in the new text document.
  • Click on File > Save As > Change "Save As Type" 
    to "All Files".
  • Give the file name Deal or No Deal.bat
    [N.B.: Do not forget to give the extension as .bat]
  • Click on Save.
  • Now double-click to Play the game. 



echo Loading...
setlocal enabledelayedexpansion
set dealdone=0
set Spaces=                                           

for /l %%I in (1,1,22) do set gapline%%I= ___________ 

set amount1=1
set amount2=10
set amount3=50
set amount4=100
set amount5=500
set amount6=1000
set amount7=5000
set amount8=10000
set amount9=25000
set amount10=50000
set amount11=75000
set amount12=100000
set amount13=300000
set amount14=500000
set amount15=1000000
set amount16=1500000
set amount17=2000000
set amount18=3500000
set amount19=5000000
set amount20=7500000
set amount21=10000000
set amount22=25000000



set famount1=$0.01
set famount2=$0.1
set famount3=$0.50
set famount4=$1
set famount5=$5
set famount6=$10
set famount7=$50
set famount8=$100
set famount9=$250
set famount10=$500
set famount11=$750
set famount12=$1,000
set famount13=$3,000
set famount14=$5,000
set famount15=$10,000
set famount16=$15,000
set famount17=$20,000
set famount18=$35,000
set famount19=$50,000
set famount20=$75,000
set famount21=$100,000
set famount22=$250,000




set Damount1={___$0.01___}
set Damount2={____$0.1___}
set Damount3={____$0.5___}
set Damount4={_____$1____}
set Damount5={_____$5____}
set Damount6={____$10____}
set Damount7={____$50____}
set Damount8={____$100___}
set Damount9={____$250___}
set Damount10={____$500___}
set Damount11={____$750___}
set Damount12={___$1000___}
set Damount13={___$3000___}
set Damount14={___$5000___}
set Damount15={___$10000__}
set Damount16={___$15000__}
set Damount17={___$20000__}
set Damount18={___$35000__}
set Damount19={___$50000__}
set Damount20={___$75000__}
set Damount21={__$100000__}
set Damount22={__$250000__}




for /l %%I in (1,1,22) do set boxtop%%I= _____ 
for /l %%I in (1,1,22) do set boxlid%%I=[_____]
for /l %%I in (1,1,9) do set boxmid%%I=[  %%I  ]
for /l %%I in (10,1,22) do set boxmid%%I=[ %%I  ]
for /l %%I in (1,1,22) do set boxbot%%I=[_____]

for /l %%I in (23,1,24) do set boxtop%%I=       
for /l %%I in (23,1,24) do set boxlid%%I=       
for /l %%I in (23,1,24) do set boxmid%%I=       
for /l %%I in (23,1,24) do set boxbot%%I=       

for /l %%I in (1,4,24) do (
set /a box2number= %%I + 1
set /a box3number= %%I + 2
set /a box4number= %%I + 3
set DisplayLine%%I=#boxtop%%I##boxtop!box2number!##boxtop!box3number!##boxtop!box4number!#
)

for /l %%I in (2,4,24) do (
set /a boxnumber= %%I - 1
set /a box2number= !boxnumber! + 1
set /a box3number= !boxnumber! + 2
set /a box4number= !boxnumber! + 3
set DisplayLine%%I=#boxlid!boxnumber!##boxlid!box2number!##boxlid!box3number!##boxlid!box4number!#
)

for /l %%I in (3,4,24) do (
set /a boxnumber= %%I - 2
set /a box2number= !boxnumber! + 1
set /a box3number= !boxnumber! + 2
set /a box4number= !boxnumber! + 3
set DisplayLine%%I=#boxmid!boxnumber!##boxmid!box2number!##boxmid!box3number!##boxmid!box4number!#
)

for /l %%I in (4,4,24) do (
set /a boxnumber= %%I - 3
set /a box2number= !boxnumber! + 1
set /a box3number= !boxnumber! + 2
set /a box4number= !boxnumber! + 3
set DisplayLine%%I=#boxbot!boxnumber!##boxbot!box2number!##boxbot!box3number!##boxbot!box4number!#
)

set amountnumber1=0
set amountnumber2=11
for /l %%I in (1,2,22) do set /a AmountNumber1= !amountnumber1! + 1 && set /a Amountnumber2= !amountnumber2! + 1 && for /l %%J in (!Amountnumber1!,1,!Amountnumber1!) do for /l %%K in (!Amountnumber2!,1,!Amountnumber2!) do (
set Displayline%%I=#gapline%%J#            !Displayline%%I!            #gapline%%K#
)

set amountnumber1=0
set amountnumber2=11

for /l %%I in (2,2,22) do set /a AmountNumber1= !amountnumber1! + 1 && set /a Amountnumber2= !amountnumber2! + 1 && for /l %%J in (!Amountnumber1!,1,!Amountnumber1!) do for /l %%K in (!Amountnumber2!,1,!Amountnumber2!) do (
set Displayline%%I=#Damount%%J#            !Displayline%%I!            #Damount%%K#
)

for /l %%I in (23,1,24) do set displayline%%I=                         !Displayline%%I!                         

set amountsleft=
for /l %%I in (1,1,22) do set AmountsLeft=!Amountsleft!%%I,


set Amountnumber=1

:RandomNumber

set minval=1

set maxval=22

:NumberGenerator
set /a RandomNumber= %random% / 1489
set /a RandomNumber= %RandomNumber% + %MinVal%
if /i %RandomNumber% GTR %Maxval% goto NumberGenerator

if not defined box%randomnumber% (
set box%randomnumber%=%amountnumber%
set /a Amountnumber= !Amountnumber! + 1
if /i !amountnumber!==23 goto intro
)
goto Randomnumber


:intro
cls
echo Let's Play...
echo.
echo.
echo          ############################################
echo          #                                          #
echo          #   @@   @@@@   @   @            @   @@@   #
echo          #   @ @  @     @ @  @           @ @  @  @  #
echo          #   @  @ @    @   @ @          @   @ @     #
echo          #   @  @ @@@  @@@@@ @          @   @ @     #
echo          #   @ @  @    @   @ @           @ @  @     #
echo          #   @@   @@@@ @   @ @@@@         @   @     #
echo          #                                          #
echo          #   @  @   @         @@   @@@@   @   @     #
echo          #   @@ @  @ @        @ @  @     @ @  @     #
echo          #   @@ @ @   @       @  @ @    @   @ @     #
echo          #   @ @@ @   @       @  @ @@@@ @@@@@ @     #
echo          #   @ @@  @ @        @ @  @    @   @ @     #
echo          #   @  @   @         @@   @@@@ @   @ @@@@  #
echo          #                                          #
echo          ############################################
echo.
echo I do not own the "Deal Or No Deal" format or concept. All copyrights
echo and trademarks are property of their respective owners.
echo.
set /p helpyn="Press enter to continue, or type HELP for instructions.
if /i "%HelpYN%"=="HELP" (
cls
echo The aim of the game is to get as much money as possible for your box.
echo The game concept is simple. There are 22 sums of money inside 22 boxes.
echo The player must choose a box to keep, then remove the others from play,
echo one by one not knowing what sum is inside each box.
echo.
echo After a certain number of choices, The Banker will phone. He will make
echo you an offer to buy your box off you. You may choose to accept this offer,
echo or keep removing money. Removing high sums makes lower offers and vice-
echo versa.
echo.
echo If you play until there are only two boxes left, you have the choice to
echo open the box you started with, or switch to the other box. You win the
echo money in the box.
echo.
echo The knack to the game is knowing whether to take the deal or stop removing
echo money from the game.
pause
)
cls


:ChooseBox
call :display
set /p OwnBox="Choose your own box to keep:    "
if not defined Ownbox goto Choosebox
if /i not %ownbox%0 leq 220 goto ChooseBox
if /i not %ownbox%0 geq 10 goto ChooseBox

set boxtop%ownbox%=       
set boxlid%ownbox%=       
set boxmid%ownbox%=       
set boxbot%ownbox%=       


set BoxesLeft=22

Set turns=5

set boxmessage=Choose the box you want to open       
call :gameloop

if %dealdone%==1 exit /b

Set turns=3
set boxmessage=Choose the box you want to open       
call :gameloop

if %dealdone%==1 exit /b

Set turns=3
set boxmessage=Choose the box you want to open       
call :gameloop

if %dealdone%==1 exit /b

Set turns=3
set boxmessage=Choose the box you want to open       
call :gameloop

if %dealdone%==1 exit /b

Set turns=3
set boxmessage=Choose the box you want to open       
call :gameloop

if %dealdone%==1 exit /b

Set turns=3
set boxmessage=Choose the box you want to open       
call :gameloop

if %dealdone%==1 exit /b

goto SwapOrNot


:gameLoop
cls
call :display
set boxtoremove=

:OpenBox
set /p BoxToRemove="%BoxMessage%"
if not defined BoxToRemove goto OpenBox
if /i not %BoxToRemove%0 leq 220 goto OpenBox
if /i not %BoxToRemove%0 geq 10 goto openBox
if /i %BoxToRemove%==%OwnBox% goto OpenBox
if /i "!Box%boxtoremove%!"=="DONE" goto OpenBox

call :removebox %boxtoremove%
set /a BoxesLeft=%BoxesLeft% - 1
set /a Turns= %Turns% - 1

if /i %turns%==0 (
cls
call :display
set /p asdfghj="You lost amount %Amountinbox%. The Phone is ringing, press enter to answer it."
set asdfghj=
call :MakeOffer
exit /b
)

set boxmessage=You lost amount %Amountinbox%. Choose the box you want to open.       

Goto GameLoop






:RemoveBox
set boxtop%1=       
set boxlid%1%=       
set boxmid%1=       
set boxbot%1=       

set AmountInBox=!Box%1!

call :Remove_Amounts %AmountInBox%
set Box%1=DONE
exit /b

:Remove_Amounts
set damount%1=             
set gapline%1=             

for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 delims=," %%A in ("%AmountsLeft%") do (
set amountsleft=
if /i not %%A==%1 set AmountsLeft=%%A,
if /i not %%B==%1 set AmountsLeft=!AmountsLeft!%%B,
if /i not %%C==%1 set AmountsLeft=!AmountsLeft!%%C,
if /i not %%D==%1 set AmountsLeft=!AmountsLeft!%%D,
if /i not %%E==%1 set AmountsLeft=!AmountsLeft!%%E,
if /i not %%F==%1 set AmountsLeft=!AmountsLeft!%%F,
if /i not %%G==%1 set AmountsLeft=!AmountsLeft!%%G,
if /i not %%H==%1 set AmountsLeft=!AmountsLeft!%%H,
if /i not %%I==%1 set AmountsLeft=!AmountsLeft!%%I,
if /i not %%J==%1 set AmountsLeft=!AmountsLeft!%%J,
if /i not %%K==%1 set AmountsLeft=!AmountsLeft!%%K,
if /i not %%L==%1 set AmountsLeft=!AmountsLeft!%%L,
if /i not %%M==%1 set AmountsLeft=!AmountsLeft!%%M,
if /i not %%N==%1 set AmountsLeft=!AmountsLeft!%%N,
if /i not %%O==%1 set AmountsLeft=!AmountsLeft!%%O,
if /i not %%P==%1 set AmountsLeft=!AmountsLeft!%%P,
if /i not %%Q==%1 set AmountsLeft=!AmountsLeft!%%Q,
if /i not %%R==%1 set AmountsLeft=!AmountsLeft!%%R,
if /i not %%S==%1 set AmountsLeft=!AmountsLeft!%%S,
if /i not %%T==%1 set AmountsLeft=!AmountsLeft!%%T,
if /i not %%U==%1 set AmountsLeft=!AmountsLeft!%%U,
if /i not %%V==%1 set AmountsLeft=!AmountsLeft!%%V,
)

set amountinbox=!FAmount%1!
exit /b









:MakeOffer
set amount=0
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 delims=," %%A in ("%AmountsLeft%") do (
set /a Offer= !Amount%%A! + !Amount%%B! + !Amount%%C! + !Amount%%D! + !Amount%%E! + !Amount%%F! + !Amount%%G! + !Amount%%H! + !Amount%%I! + !Amount%%J! + !Amount%%K! + !Amount%%L! + !Amount%%M! + !Amount%%N! + !Amount%%O! + !Amount%%P! + !Amount%%Q! + !Amount%%R! + !Amount%%S! + !Amount%%T! + !Amount%%U! + !Amount%%V! + 0
)
set /a Offer= (%Offer%/((%BoxesLeft%*999)/500))/100


cls
echo.
echo               ####################################       
echo              ##                                  ##      
echo             ##    ############################    ##    
echo              ######     ##            ##     ######       
echo                      ######################        
echo                      #######        #######      
echo                      #####            #####       
echo                      ####              ####     
echo                      ####              ####   
echo                      #####            #####   
echo                     #######          #######
echo                    ##########################
echo                   ############################         
echo                  ##############################           
echo                 ################################          
echo.
echo.
echo                   The Banker Offers: $%Offer%
echo.
echo.
echo                        DEAL OR NO DEAL?
:DealOrNoDeal
set deal=
set /p Deal="       "
if not defined Deal goto DealOrNoDeal
if /i %Deal:~0,1%==d echo.&& Goto Deal_Taken
if /i %Deal:~0,1%==N (exit /b) else (goto :DealOrNoDeal)









:Display


echo/ %displayline1:#=!%
echo/ %displayline2:#=!%
echo/ %displayline3:#=!%
echo/ %displayline4:#=!%
echo/ %displayline5:#=!%
echo/ %displayline6:#=!%
echo/ %displayline7:#=!%
echo/ %displayline8:#=!%
echo/ %displayline9:#=!%
echo/ %displayline10:#=!%
echo/ %displayline11:#=!%
echo/ %displayline12:#=!%
echo/ %displayline13:#=!%
echo/ %displayline14:#=!%
echo/ %displayline15:#=!%
echo/ %displayline16:#=!%
echo/ %displayline17:#=!%
echo/ %displayline18:#=!%
echo/ %displayline19:#=!%
echo/ %displayline20:#=!%
echo/ %displayline21:#=!%
echo/ %displayline22:#=!%
echo/ %displayline23:#=!%
echo/ %displayline24:#=!%

exit /b



:SwapOrNot
cls
echo.
echo               ####################################    
echo              ##                                  ##   
echo             ##    ############################    ##   
echo              ######     ##            ##     ###### 
echo                      ######################        
echo                      #######        #######         
echo                      #####            #####     
echo                      ####              ####  
echo                      ####              ####   
echo                      #####            #####      
echo                     #######          #######
echo                    ##########################
echo                   ############################           
echo                  ##############################       
echo                 ################################       
echo.
echo.
echo                The Banker Has Offered You The Swap
echo.
echo.
echo                        SWAP OR NO SWAP?

:SwapOrNoSwap
set swap=
set /p Swap="       "
if not defined Swap goto SwapOrNoSwap
if /i %Swap:~0,1%==S echo.&& goto Swap_Taken
if /i %Swap:~0,1%==N (echo.&& goto Swap_Not_Taken) else (goto SwapOrNoSwap)




:Swap_Not_Taken
for /f "tokens=1,2 delims=," %%I in ("%AmountsLeft%") do if /i "%%I"=="!Box%OwnBox%!" (set Offer=!Amount%%I!& set OtherBox=%%J& Set OwnBox=%%I) else (set offer=!Amount%%J!& set OtherBox=%%I&& Set OwnBox=%%J)
if /i %offer% lss 100 set offer=0.%offer%&& goto SwapResult
set /a offer= %offer% / 100
if /i %Offer% geq 35000 call :bigWin
goto SwapResult






:Swap_Taken
for /f "tokens=1,2 delims=," %%I in ("%AmountsLeft%") do if /i "%%I"=="!Box%OwnBox%!" (set Offer=!Amount%%J!& set OtherBox=%%I& Set OwnBox=%%J) else (set offer=!Amount%%I!& set OtherBox=%%J& Set OwnBox=%%I)
if /i %offer% lss 100 set offer=0.%offer%&& goto SwapResult
set /a offer= %offer% / 100
if /i %Offer% geq 35000 call :bigWin






:SwapResult
if /i %OwnBox% gtr %Otherbox% (
Echo You took the chance and won :D Well done
) else (
echo Hard luck, you got the smaller prize.
)
echo You won $%Offer% :)
pause>nul
goto endofgame






:Deal_Taken

set dealdone=1

if /i %Offer% geq 35000 call :bigWin

if /i %offer% lss 100 (
set Newoffer=0.%offer%
) else (
set Newoffer=%offer%
)


set temp=!Box%ownbox%!

if /i !Amount%temp%! lss 100 (
set Newtemp=0.!Amount%temp%!
) Else (
set /a Newtemp= !Amount%temp%! / 100
)

if /i %newtemp:.=% gtr %offer% (
echo Hard luck, in your box there was $%newtemp%, but you dealed at $%Newoffer%
)

if /i %newtemp:.=% lss %offer% (
echo Well done, you beat the banker :D
echo Your box was worth $%newtemp% but you sold it for $%NewOffer%
)

if /i %newtemp:.=% equ %offer% (
echo You managed to sell your box for exactly what it was worth, well done :D
echo You won $%NewOffer% :)
)
pause >nul
goto EndOfGame











:BigWin
cls
echo #######################################################
echo #                                                     #
echo #                                                     #
echo #   @       @   @   @   @   @   @   @@@@   @@@@   @   #
echo #   @       @   @   @@  @   @@  @   @      @   @  @   #
echo #   @       @   @   @ @ @   @ @ @   @      @  @   @   #
echo #   @   @   @   @   @ @ @   @ @ @   @@@    @@@    @   #
echo #   @  @ @  @   @   @ @ @   @ @ @   @      @  @   @   #
echo #   @ @   @ @   @   @ @ @   @ @ @   @      @   @      #
echo #    @     @    @   @  @@   @  @@   @@@@   @   @  @   #
echo #                                                     #
echo #                                                     #
echo #######################################################
echo.
echo.
exit /b





:endOfGame
exit /b