The purpose of this study is to develop a curriculum of school mathematics and artificial intelligence regarding max-min problems. We also developed a coding environment for a designed curriculum that can be accessed and utilized at codingmath.org without any additional installation. The curriculum uses an evolution strategy-based gradient descent method founded on a school probability and statistics curriculum with an experiment using dice; this curriculum is designed to work when the function is not differentiable and is ultimately linked to a calculus-based gradient descent method. The coding environment, in which even middle school students can visualize the min-max problem of , uses a three-dimensional function graph with minimal coding inputs and explores the gradient descent process using a two-dimensional Python animation. This study, which is an attempt to combine mathematical problem solving and computational thinking in the context of max-min problems, further discusses ideas regarding the ways to integrate AI and coding in mathematics education.