Solved Batch File Double Variables To Make A Variable HELP

Lenovo Essential g560 0679alu 15.6" led...
September 4, 2012 at 21:58:02
Specs: Windows 7, 2gb
Okey, So i am making a batch game.

its called boxes. its a game where you vs another player.

its placed on an even grid 9x9 and each move is drawn from one dot to another (up down left right) once a box is formed, thats your point.

now heres is the idea .. kinda

iv set each grid %var% into its true form (EG: set #22=STR)

so once a move is made on the grid, buy typing grid location (EG: 54) which will be reconised as #54 and allowing to locate the grid. set as %move%

now, setting the vars

i set a direction, indicated by, 1=up 2=down 3=left and so on..

now the direction variable gets set as:

SET /p fnd=1

if "%fnd%" == "1" set D= I
if "%fnd%" == "2" set /a dwn=%move% +10 (it places it on the next line of the grid)
if "%fnd%" == "3" etc...

Anyway The Problem Is This Peice:

i need to set the direction as the move.. the move starts off as " ."

then up replaces it to " I"
but it cannot be repeated.


grid number = 54 is known as a variable.. which is #54 = . (grid dot)

move = #54

direction = I

problem = if "%%MOVE%%" == " ." set %move%= I>>temp.bat
call temp.bat

i did find a shortcut way, but it didnt support the games logic into changing charaters

the problem basically is:

how can i combine a set variable "1" into becoming the variable

so %var1% = 54, i need "%" signs around the 54 of var1 without it joining the two signs..


set #54=A

set move=54
set move=#%move% (adds the # to 54)

if "%%move%%" == "A" set %move%=B

so hard to explain

See More: Batch File Double Variables To Make A Variable HELP

Report •

September 4, 2012 at 23:48:27
✔ Best Answer
Dont worry, i fixed it by:

set #22= .
set move=22
set move=#%MOVE%

set debug=%%!%move%!%%

SET no=%debug:!=%

echo if "%no%" == " ." set %move%=I>>3.bat

echo BEFORE = "%#22%"
call 3.bat
if "%no%" == "I" set no= I
echo AFTER = "%#22%"


Report •
Related Solutions

Ask Question